- Home /
Problem using mecanim and the Animation process
Hello,
I am actually implementing animations for our player (a flying fish) in a 2D game. The current state animation works out of the box and was pretty simple to integrate via mecanim.
My problem comes when I want to add the death condition which actually needs to change some of the transforms value of the player like the position or the rotation of the gameoject.
One another problem is that I need to animate differently my hero whether I am in the "sky" or in the "water".
In fact, when we die in the water, our fish need to make a 180° rotation and a translation from his position to the surface.
When we die in the sky, I need to animate like a sort of dive to the surface.
I've tried 2 solutions:
With the curves in Unity Editor ; I can't animate from the current position of the player therefore it's not OK and I can't use this solution properly.
Legacy in the code. I had to create a sort of curve with multiple Vector3 (too much...) and animate my player like if I told him to move from A to B and the repeat the movement with the all set of Vector3.
I’m not OK with the second solution because as soon I need to change something to my animation, it means I need to go back to my legacy code animation and change all of the Vector3, test it back, etc...
Do you guys have any ideas? In advance, I apologize for my English and if I was not clear.
Thanks.