This feature allow you to get an IElement. It doesn’t matter if the object is in the level or not, if it is not loaded, the node will return the saved object.
The GetObject node
Select the class of the object that will be returned. (Needed because blueprint does not support dynamic cast).
The identifier of the Element to return.
Allow the node to generate the object from its saved state. If false only real object can be returned.
See paragraph below.
The max depth in the deepObject tree to generate, starting from the returned Object.
-1 : infinity
This is currently needed after each use of the getObject node, even if no object was generated. It is also the only way to serialize a generated object. It will cleanup generated objects.
There is two differents nodes for EndGetObject, use the one you prefer.
Below are two different versions of a GetObject with EngGetObject.
Use this if you want to directly get a deepObject in an element tree.
TryCastTo will then need to match the returned DeepObject’s class.
Only the given path is generated, this allow you to optimise your getObject in a complex element.
In this exemple we are using :
– TryCastTo : my_object’s class
– DeepPath : [0,1]
– MaxDepth : 1
Orange one is the returned object.
Green ones are objects we will check, and will generate these from a saved state if not valid. We will also try to resolve objects using saved softObjectReference at each stage allowing you to modify a deepObject that is loaded from a parent that is not, in this case we don’t deserialize it (it is in the world).
When you’ll EndGetObject, only Green and Orange objects will be serialized (if checked) but sub datas will stay.
Out of Scope
If “MyObject” make changes on “AnotherActor” that changes won’t be saved because “AnotherActor” is out of the GetObject’s scope.
You’ll need to use this :
– TryCastTo : mycomponent’s class
– DeepPath 
– MaxDepth : 2
And get the my_object from there.
In this element tree we have one object named “TwiceRef” that is a deepObject of two different objects : “AnActor” and “Something1”.
In this case you can access it using both path : [0,1,0,0] and [1,0,0,0,0,0].
If the object is loaded, that is realy fast (it’s a map access where key is a int and depend of the number of elements in this archive). If object must be generated, it will mostly depend if datas are cached (archive is loaded) or not.