- Home /
Eye bone twisting
I have a bone-based eye that needs to look towards a target. You would think this would be as simple as using transform.forward = direction
, but Blender and Unity's bone axis differ. To compensate, I set transform.right
instead.
This results in unwanted "twisting" of the eye, as you can see here:
How would this be done correctly?
@dzebna That doesn't get around the Unity/Blender axis problem. transform.forward
does not match up the the direction a bone is really facing. Ins$$anonymous$$d, it's -transform.right
Answer by andrew-lukasik · Jul 02, 2014 at 01:33 PM
This should help:
transform.LookAt( target );
transform.Rotate( new Vector3(0f,-90f,0f) , Space.Self );
Surprisingly simple! I was going about it the other way around, trying to add an offset to the target vector.
Your answer
Follow this Question
Related Questions
Attaching a Model to a prefab at runtime 0 Answers
Unity Rotation In Animation Goes In Opposite Direction 2 Answers
Mesh Import Transform Problems 0 Answers