Rotating on a keyframe sends previous animation haywire

When I move my ship on the timeline without rotating it, the animation works fine.
After rotating the ship, the previous parts of the animation go haywire, sending the ship off screen but still showing the same coordinates if I rewind to the start, despite the fact that the ship is clearly not at the same coordinates. What am I doing wrong?

Hi,

Welcome to our community! :slight_smile:

Did you set all properties and initial values (especially the rotation values!) in the very first keyframe? If not, Unity uses the values from the first keyframe that accesses the rotation property. If it’s keyframe 99, you get a ‘funny’ rotation as of keyframe 1.

Did this help you fix it?


See also:

I haven’t specifically ‘set’ any properties that the first keyframe didn’t set itself. I started recording, moved the object up and down to set its first position then moved the timeline on to 2 seconds, then moved the object, etc.
If I was meant to ‘set’ the properties in another way, how do I do that?

Click the three dots in the PlayerRig box in the Timeline. Then open the animation. In the Animation Editor, you can select the first keyframe and add all properties you want to use in your animation. Give them initial values, save the animation, then test your timeline animation again.

I have deleted the timeline as the problem appears to be with the rig. The rig is supposed to encompass the camera and the ship, I animate the rig and that is ok, until I want to move just the ship in the code, but the ship doesn’t have 0,0,0 coordinates, it has similar coordinates to the rig (and also the camera). I have tried deleting the rig and its contents and redoing them, but I never get 0,0,0 for the player ship. I created a program with a new terrain and rig, and the player ship in the new setup works as expected, 0,0,0, I would however, like to rescue my previous version if possible, as I put in a lot of effort, there just seems to be a bug that I am not qualified to find or fix.
Any help would be greatly appreciated.

The Player Ship must not be animated. Only the Player Rig may be animated. If you set all properties in the very first keyframe, the rotation should work as expected.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms