Camera location issue when configuring Gameplay Camera System (Experimental) with StateTrees as Director

Hey UE Forum :slight_smile:

Since UE 5.6 added support for StateTree as the Gameplay Camera System director I’ve decided to give it a go! (love trying out the new features)

This is my previous Blueprint Camera Director Evaluator logic:

This is the exact same logic (unless I’m missing something) but with a StateTree:


The data is taken using a Global Task:

With a straight-forward logic:

Now it all seems to work (transitions work fine!) except the location of the Camera when using StateTrees seems to be waaay off the back:
This is with Blueprints:


This is with the StateTree:

(You can see the UI to differentiate between the Camera locations)

Anyone has stumbled upon this and know a fix?
Is this something with the new StateTree x GameplayCameraSystem integration that should be fixed?

P.S.
If anyone knows a solution to the ‘TODO’ I’ve left there feel free to also let me know :sweat_smile:

Update:
I’ve managed to solve the issue :slight_smile:

On a high-level the problem was that for StateTrees we don’t want to Activate Camera Rig, every frame (as opposed to the Blueprint Director that works fine with by frame activation).

With that the solution was to refactor both the State Tree and the Global Task so that once we get to State where we want to Activate a Camera Rig, we stay on it, and we transition only when data changes.
This is the new StateTree:

Hopefully everything is clear from the text underneath each State.

Now all is left is to re-evaluate the camera, this is done using a Transition by Event and the event is sent from the Global Task whenever data changes:




Note that we must at least once to re-evaluate the tree for the Camera to work…
Not sure if this is some issue, or something by design that I’m not familiar with.

Hope this helps anyone :slight_smile: