Animation Select

Forums:

This one tripped me up today. No matter what I did, I could not get the controller to play the animation I wanted. The controller was firing, it was not null but the anim called within the controller would not play.. ugh.
As it turns out, I did not notice that there was a drop down on the top of the animation editor and it was set to the wrong animation for that object. (More on door anim).. Basically what I was doing was working on the wrong animation. My first clue should have been that there was no "Motion" under the animation controller for that animation. All of the other ones did. You can see the "motion" by click on the animation in the controller (top right). Once I opened the animation in Assets, clicked on the object in the scene and then selected "HomeDoorSwing" from the dropdown list, the animation started working. To fire as an example, I simply placed a cube with gravity above the "welcome mat" that fires the door animation. When I started play, the cube dropped on the mat, console said it collided, the door open audio source fired and the door opened. If you notice in the controller above, I have it opening at a .05 speed rate followed by a copy of the door open but with a speed rate of -.01 which closes the door after a few seconds. Then I make a transition from DoorOpen to DoorClose and then to Exit so that it does not loop.