StateTree task only ticking once

The concept of using StateTree with Mass is to have tasks that add or modify fragments that are then executed on by Mass processors. This is done because UMassStateTreeProcessor requires the game thread to be run, and ticking all StateTrees on the game thread would be quite expensive (30k pedestrians in CitySample all running a StateTree). The method certainly has a misleading name, but it does tick when used in the Actor context of the engine.

The Mass StateTree should only ever “Tick” when it needs to re-evaluate a possible transition. This is done in how the MoveTo tasks and processors work. You can set up your own signals to use if you want a periodic tick of the StateTree, but this would not be recommended. Instead, we advise moving logic out of the Tick on the task and into a processor’s Execute method.

1 Like