- Home /
Animation mecanim state
Hi all. How do I incorporate a rotating animation to an animation. Example: I have a fish swimming(animating) across the screen. At any given point of it's movement state...when clicked on...I need it to switch state...to my rotation animation and then when rotation is done...resume along it's original path(movement state) where it was before the rotation.
What is happening at the moment is: When I switch state....the rotation animation happens off screen...where I created it. Can anyone help me with the logic here.
Thanks in advance.
Forgot to mention it's in 2D. Used the sprite2D(Texture type) editor - PNG sliced.
Answer by Tropicana · Sep 19, 2014 at 02:06 PM
Does the rotation animation changes the position of the fish object? If it does, try to place the fish object under a parent and rotate it around the parent. if you animate the parent, it records its world position and rotates around there ! And you need to Translate the position of the parent to make it move along the world.
Your answer
![](https://koobas.hobune.stream/wayback/20220613163324im_/https://answers.unity.com/themes/thub/images/avi.jpg)