Tweaking screen transitions not to fire every time

I’m making a simple screen transition system for my game which consists of two states firing the right clips (one for the starting half od the transition animation, one for the ending one) and a condition between the end and start one which is set to true when user wants to change the level (so that the Start animation would fire in the previous animation and the End in the new one).

This is cool and all but poses two problems - firstly, the game starts with the End phase animation which looks a bit weird. Secondly, since the Restart button in the main game just reloads the level, it causes the End transition to fire every time too which looks weird and out of place.

How would I go about tweaking the Animator so that the End phase only runs when I actually change the level as opposed to when starting the game or reloading the current scene?

No ideas? :frowning:

Maybe there’s some way to pass some kind of a parameter when loading a new scene? This way, I could just pass a flag like shouldFireEndAnimation so that it does not fire when the game just starts or a level restarts.

I can’t think of a straightforward way to do what you want off the top of my head with Animator Controllers, but you might be interested in Animancer (link in my signature) which lets you control all your animations in scripts so you can play or not play them based on whatever logic you want.

1 Like

I see, thank you. Will give Animancer a look, though I’d hoped there’d be an easy way of doing this with vanilla Unity :frowning: