On my Behaviour Tree I have a task which creates an instance of a UOBJECT, and inserts it into the blackboard key.
A task to the right later retrieves the value of this key, and calls something on the UOBJECT.
I am using a Sequence on the tree, so there’s no way for the task on the right to run if the left did not successfully populate the blackboard key with the object.
This works fine the vast majority of the time, but then I suddenly get an access exception on the right task, because the object is null.
I can only assume the object is GC’d? How can I prevent this, and why would the GC go for an object found in a blackboard key?