- Home /
Create Animation in unity3d only on one axis
Hi , i try to create animation in unity3D for move game object between -5 and 5 on x axis . i want to when i attach this animation to object it`s move between -5 and 5 , but my problem is : when i add curve to x axis unity automatically add curve to y and z too ! so when i attach this animation to other object it`s change object transform position on x y z axis but i only need to move on x ! what should i do for solve this problem ? thanks
Answer by Paulius-Liekis · Nov 16, 2012 at 10:43 AM
You can not create a curve for X only. Unity doesn't keep 3 curves of float, it keeps one curve of Vector3. That's why it always comes in triplet (x y z).
You have to workaround your problem in some other way, for example: overriding y and z in LateUpdate (i.e. after animation has been sampled), or sample animation on another object and copy x value from it.
Your answer
Follow this Question
Related Questions
Create Animation in unity3d only on one axis 0 Answers
How can i move a Keyframe on an Animation Curve with overwriting the key on the target time? 1 Answer
SmoothDamp not working? 1 Answer
how to delete specific animation curve on import 0 Answers
How would I go about making an animation affected by this script? 1 Answer