x


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?

more ▼

asked Jun 08 '10 at 06:29 PM

Toxic Blob gravatar image

Toxic Blob
656 18 20 33

(comments are locked)
10|3000 characters needed characters left

1 answer: sort oldest

Try this:

Put the model and animations inside an empty game object and move the character by using the transform of the container.

more ▼

answered Jun 08 '10 at 11:16 PM

spinaljack gravatar image

spinaljack
9.1k 18 31 91

Hehe, yes, I had thought of the double transform method. I was more hoping for further information on how to properly use AnimationCurve.Evaluate... :)

Jun 10 '10 at 08:03 AM Toxic Blob
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3807
x63
x57
x8

asked: Jun 08 '10 at 06:29 PM

Seen: 1878 times

Last Updated: Jun 08 '10 at 06:29 PM