I’m experimenting with state trees, and in one of my states I want to stop any movement my AI character might be performing. For that I am storing a reference to the async task AITaskMoveTo, obtained from “Move To Location or Actor” node, in a variable in my AI character.
I’m calling “Move To Location or Actor” node in two different places:
The issue I’m encountering is that the value set in the State Tree Task is valid when it reaches this point and the one that is set in the GameplayBehavior is invalid, even though the movement is still running.
Anyone know why this happens only for GameplayBehavior and what is the work around?
It’s moving as expected with both “MoveTo” nodes. The target locations for each are different.
To give a little bit more context, the GameplayBehavior belongs to a SmartObject and is being triggered by “UseSmartObject” node within a state tree task, then the GameplayBehavior calls the “MoveTo” node to the location specified in it.
So I know the Character is moving as intended. And it’s storing the async task value correctly, the thing is as soon as it reaches state tree task to end it, it is invalid for some reason, that I don’t understand.
The AI Character has it’s own AIController, but it’s not using behavior tree it is using a state tree component instead.
On further inspection, the AsyncTask shows as valid on Character tick. So this is definitely related to the StateTreeTask and how it handles the Context Actor, which is where I’m storing the AsyncTask.