- Home /
Redefine axis of an object
How do you redefine the axis of an object?
Comment
Best Answer
Answer by Joshua · May 05, 2011 at 04:22 AM
You can only actually set that up inside the modeling program you are using.
There is a trick to work around it though. The object you want to change the axis on I'll call ObjectX:
- create an empty GameObject
- make the empty GameObject the child of ObjectX
- reset the Transform of the empty GameObject (it should now center ObjectX)
- unparent the empty GameObject
- rotate the empty GameObject so that it's axis are the way you'd like them to be on ObjectX
- make the empty GameObject the parent of ObjectX
rather hackish in-editor way... pity there is no way to change it at runtime using a script... well i guess you could create a gameobject, dynamically parent, move etc - would be nice if there were a transform.SetPivot()
operation
Yeah, I absolutely agree. It should be easy as well, since the rigidbody already calculates a center of mass, just work from there ;).
Answer by Lukas_GMC · Feb 18, 2013 at 11:55 PM
The gamedraw package has a center pivot button. Works perfectly.