- Home /
How do I calculate the offset for
I want to use transform.LookAt on a number of different transforms. The only problem is that the transforms are all oriented in different directions (their global x, y, and z are all pointing different directions). So when I use LookAt, they objects appear to flip in funny directions compared to how they started.
I can't change the transform's starting orientations in the modeling program, because they actually need to be the way they are.
So what I am trying to do is figure out how to get the same effect as LookAt but take into account the offset orientation that they start with.
Ideas?
Answer by Azound · Dec 02, 2009 at 04:58 PM
you could make them a child of a new gameobject, and then call LookAt on the new gameobject's transform. That would maintain the child's transform relative to the parent, rather than overriding it.
Your answer
Follow this Question
Related Questions
Flip over an object (smooth transition) 3 Answers
RotateAround Limitations 2 Answers
gimble lock and rotation problem 2 Answers
eulerAngles.y always returns 179.9999 1 Answer
Rotating, stopping, rotating again. 2 Answers