- Home /
LookAt() rotation difference from rotating the object(position does not change)
Hey all, wanted to play around with THIS question, it's led me to a question of my own..
when I rotate my model using the rotation tool in my scene view, it appears to stay centered and rotate.. I notice that in the inspector tab, the position IS actually changing though..
if I rotate the same object with transform.LookAt, it appears to be orbiting some other axis, not staying put... I notice the position does NOT change..
what gives?
here is a sample project:
http://dl.dropbox.com/u/11203897/swordLookAt.zip
if you play the scene and move the mouse around, you will see the sword is flying around.. why?
thanks!
The link to the sample project is actually sending to the question
Answer by Seth-Bergman · Mar 16, 2013 at 12:06 PM
OK, turns out this was a loaded question.. I figured it out by opening the model up in 3DS, where the object's pivot was indeed way out there... fixing the pivot and re-exporting fixed the issue. Still, odd to me that the rotate within the scene is smart enough to use the models center, while the code uses the FBX pivot it seems..
here is the fixed project example:
Your answer
Follow this Question
Related Questions
Rotation using Unity2D 3 Answers
LookAt inaccurate rotation issue (javascript) 1 Answer
Lock rotation axis? 4 Answers