How to assign StateTree parameters at runtime

I just started using FStateTreePropertyRef today with UE 5.5 for writing values to variables from tasks to be used by later tasks and it works quite well. I used FStateTreeRunEnvQueryTask as reference and changed my tasks to be derived from FStateTreeTaskCommonBase instead of UStateTreeNodeBlueprintBase, which is viable for me since I’m not using blueprints for several of my tasks. When you create your InstanceData struct with the FStateTreePropertyRefs, you simply promote those to a parameter on the Task that will be writing to your variable, then reference the parameter in later tasks to get the modified value.

There are some things that do not work as expected. For the InstanceDataType structs, you cannot specify the Category of the FStateTreePropertyRef to be Output, otherwise you cannot promote/bind that to a parameter on the state tree. So for example, a runtime writable float would need to be declared like this without the Output category in order to be able to write to it:

UPROPERTY(EditAnywhere, Category = Out, meta = (RefType = "float"))
FStateTreePropertyRef AfterAttackDelay;

You don’t get the nice UI showing that the parameter is an output parameter this way unfortunately.