Hey,
I need to dispose a struct, which is the Method on a custom Action Node that I need to hook into for that?
Thanks for your help,
Nixon
Hey,
I need to dispose a struct, which is the Method on a custom Action Node that I need to hook into for that?
Thanks for your help,
Nixon
Hi @NixonAroboX
Is your struct supposed to be kept alive for the duration of the game or just for the duration of the node? You can use either the Node.OnEnd
or the destructor depending on your need.
Yea, kept alive for the duration of the game and then properly disposed, to avoid memory leaks.
So Node Destructor it is?
In that case the node destructor should be the way to go. The instance of the node should be kept alive with the agent.
I’ve just give it a try with an existing node and seems like the behavior is a bit random in the editor though. However I would recommend the destructor for the time being, if there any leak it would lies on the BehaviorGraphAgent responsability.