Different States On Load

Hello!
I have elevator doors and I’ve made 2 animations for it: opening and closing. Everything works OK except all doors play default animation on load, but I want some doors to be just opened and some to be just closed initially. Do I have to have 2 additional static states or how should I make it?

Add 2 idle states using the same clips with speed 0.

Then if your Door script wants to start closed its Awake method can call animator.SetBool(“doorsOpen”, false) and animator.Play(“elevatorDoorsClosed”) to jump immediately to that state.

It’s an awfully hacky solution, but everything in Mecanim is like that.

1 Like

You might be interested to know that this post inspired me to make an example scene for my Animancer plugin which demonstrates how you can implement a system of doors that can start open, closed, or anywhere inbetween using only one animation which you simply play forwards or backwards as necessary.

1 Like