To be honest I’m surprised that works… actions generally don’t get triggered until the transition is complete! (I would expect it would work with an instant transition but not a crossfade…).
As I read through this I thought of another idea, though this shouldn’t take away from @MarkHunte’s approach since it is easier to follow.
My code-less approach would be to use a persistent symbol on the first scene to keep track of state. The advantage is that you don’t need to worry about including anything into your buttons returning to the scene. The disadvantage is you have to think in “reverse” a bit – the default state is your final state and you need to setup the first time view animations separately.
Here’s what you’d do:
- Create a persistent symbol. No need to add it to any other scenes than the one that needs to remember its state.
- Create a custom behavior called “Initialize” that Continues a timeline (no restart) and make that new timeline
- On this timeline add a timeline action that triggers a custom behavior called “Setup”
- Exit back to your scene and in the Scene Inspector add a Custom Behavior called “Setup” and have this run a timeline that does whatever initial animations you’d like.