- Home /
Start sprite animation at the same index that the previous animation stopped
I have multiple animation (idle, running, jumping, walking...) and another animations shooting (idle_shooting, running_shooting, jumping_shooting, walking_shooting). I need to know how can I start a shooting animation with the same index that the previous animation stoped, like running[7] ->running_shooting[7], jumping[3] -> jumping_shooting[3] .
Any sugestion will be very helpful.
I'm a little confused, can you confirm if I understand this correctly:
You want an animation1 to stop, play animation2 and resume animation1 from where it stopped?
Sorry, my English is not very good. The animation "running" begins in infinite loop, when I press the button to shoot the animation changes to "running_shooting". I need to start the animation "running_shooting" in the same index as the animation "running" suffered the transition, but i dont know how can i do this.
Answer by Ben-Stoneman · Feb 16, 2015 at 09:25 PM
For 2D you may find it easier to have 2 separate animations and have them play at the same time.
Your issue could also be solved by using "Blend Trees":
I am not able to do that... I'm trying to solve it since you answered me... i don't found anything about my problem...
Answer by tebandesade · Feb 25, 2015 at 07:01 PM
Hi! Have you tried using animation blend trees? https://www.youtube.com/watch?v=HeHvlEYpRbM http://docs.unity3d.com/Manual/class-BlendTree.html
Ben Stoneman already mentioned it... i will try one more time.
Your answer
Follow this Question
Related Questions
2D Animation does not start 1 Answer
Setting animator parameter on a single instance of a prefab sets the parameter for all instances 3 Answers
Object not moving after changing animator parameter 1 Answer
2D Character getting a weapon. Changing it's sprites/animations 0 Answers
Animator warning in editor, animation is preventing script from working 1 Answer