Hello! I’m attempting to use the state tree like so:
Basically, I have two actions, move and attack. Both are triggered by a player input, and the target is provided by a struct passed to the event.
The Move phase of Attack (I used to have them linked better, but I separated it to help diagnose this issue) works just fine (also note I disabled it here for testing) - the unit moves to the target.
The problem happens when that finishes. I have it, in this example, moving to my DoAttack stage, which right now just has a debug print. However, upon transitioning to this stage, the engine crashes because, for some reason, the event data gets nulled (garbage collection maybe? hard to figure out for sure.) and it tries to add it to EventsInUse, which dereferences the null pointer and causes it to fail the assert.
I’m wondering if maybe I’m just using the state tree events wrong. My assumption was I could use it to do what I’m doing here (another example would be a ChasePlayer event where you pass the player you’re chasing to it.) The event is created in a blueprint and then fired to the state tree.
I’d like to use the state trees as a preempt-able AI system - allow its intelligence to operate unless the player performs some kind of action. I’ve tried several things, like caching the event parameter, making it a variable, etc (to make sure it isn’t some kind of GC issue, but maybe I missed something.)
Any ideas or is this an actual bug? I can’t be the only one using state trees like this right?