game object not rotating on its pivot
Hey Guys,
I have a spaceship in my game that flies around on the XZ plane in the scene(the Y position, X rotation, and Z rotation of the rigidbody are frozen in the Inspector). The ship rotates via AddTorque.
The problem I'm having is that it's not rotating around the pivot point near the center, but around the very back of the ship, making it look as if it's being swung around(there is no pivot point in this location). Has anyone else had a problem like this? Is there a solution?
I should mention that I've got the two buttons at the top set to "pivot" and "local"(I was going to post a screen cap, but I kept getting a parsing error when trying to do so).
Answer by Eric5h5 · Jan 21, 2016 at 02:50 AM
In the editor you can switch between pivot and center by clicking the appropriate button, but the pivot when using code is where the actual pivot point for the model is. You'd need to fix the model.
No, that's what I was trying to clarify, is that the pivot is near the center of the model where I intended it to be. There is no pivot point where it is rotating from, in either the top empty game object or the actual model below it.
The pivot is at (0, 0, 0). $$anonymous$$ove the model (in your modeling app) so the pivot point is where you want it. You can play around with moving the model relative to an empty (which is the parent of the model) and rotate the empty, but it's easier in the long run just to fix the model.
Your answer
Follow this Question
Related Questions
World Rotation Around The Player Lead me to a Strange Result! 0 Answers
Character Shooting Mechanic 2D Issues 0 Answers
Getting a pivoted look at in 2D 2 Answers
Set Rotation of GameObject 1 Answer