- Home /
Adding a playing animation onto a transform (with a transformation)
I have an object with two animation clips: "idle" and "jump". When I play the jump animation Unity overwrites existing transformations and returns my character to the origin for the jump.
What I really want is to ignore the Position.x & Position.z components of the animation, and to just add the Position.y onto any existing transformation that I have.
I had thought of using AnimationCurve.Evaluate
to return a float which could be added to my existing transformation, but I can't figure out how to refer to just the Position.y of the "jump" animation clip. Is this the best approach, or is there a different method entirely?
Answer by spinaljack · Jun 08, 2010 at 11:16 PM
Try this:
Put the model and animations inside an empty game object and move the character by using the transform of the container.
Hehe, yes, I had thought of the double transform method. I was more hoping for further information on how to properly use AnimationCurve.Evaluate... :)
Your answer
Follow this Question
Related Questions
Editing mecanim animation from script 0 Answers
Unity 5.5: Jump to Frame in Unity Animation Window 0 Answers
How to add a curve to a .anim ? 0 Answers