Hi all… I hope I can explain this properly.
I am using the animator for some simple animations. One of them is to warp in a spaceship onto the screen. In the animation window, I also set an “isAlive” boolean in my script to false when the animation starts and to true when the animation is done. Seems to be working alright.
If I animate to another state, the isAlive boolean is set back to false. This of course messes up my game since the ship has not been destroyed.
Is this normal behavior? Am i I not fully understanding how this works? Why would the boolean change?
thanks,
–john
Oh well… I guess I stumped the crowd. 
I made a change and added an event to the animation timeline that sets the boolean, and that seems to work.
I guess even though you can add a boolean variable from your script to the timeline, it will set it, but will “unset” it once you go to another state… at least that is what I was experiencing.
I would suggest having it as false becomes what true currently is, and make true what false is, then if it ‘unsets’ it will be what you want, false.
Thanks Raven,
I am beginning to wonder if setting a boolean in an animation event works at all. I tried it a few times, and I do not seem to have success. Since a boolean can’t be “half-true” when the animation is 50% complete, for example. I dunno.
I am leaning towards just adding an animation event, and setting what I need.
I would suggest using an animator controller, you can handle alot more animations that way, and with much more ease of use. It’s very simple, and allows you to move between multiple animations very easily.
Here is the documentation on it: