I have been trying to figure out a solution to this for hours but just cannot. I want to be able to play a different animation using the same key press.
heres what Im doing so far, if the player is holding down the Up key then play the default animation.
heres what I want to do, if the player collides with this object then disable the default animation, if the player is holding the up key play the new animation.
I am using two different scripts, one for movements and one for collision.
The movement script has the default animation inside of it and the collision script has the new animation in it.
I thought for sure it would work if I stop the default animation on collision and then putting, if user holds up key play new animation, but it didnt.
I have also tried combining the two but no luck.
We need a animation.Disable and animation.Enable function or something like it.
I could of just put this in my script,
if the user collides with this object then animation.disable("DefaultAnimation");
animation.enable("NewAnimation"); if user holds up key play new animation. Or something like that.
so how to play different animation using the same button press?
Anyway any solutions/feedback/help to my problem will be very much appreciated.
anyone who can help me solve this wins a Well-Done Steak, mash potatoes and a Cherry Icee.
EDIT: After making this post I just had to go and submit the idea for a animation.disable and animation.enable function in scripting.
so if you think its a good idea vote for it please
http://feedback.unity3d.com/forums/15792-unity/suggestions/2485428-enable-and-disable-animations-in-script
IMO this feature would make a lot of things easier and would be extremely useful to have.
↧