- Home /
Object facing the wrong way?
So I'm basically writing an application that requires a capsule to point towards the bottom of another object. My problem is that if I use "LookAt" then the capsule points 90 degrees away from it because the capsule isn't pointing in the correct direction initially. Is there any way to change this?
My code is the following:
var Target1: Transform; var Self1: Transform;
function Update () { var targPosition: Vector3 = new Vector3(Target1.position.x, Target1.position.y - 1, Target1.position.z); Self1.LookAt(targPosition); }
Thanks in advance
Answer by 3dDude · Aug 02, 2010 at 07:08 PM
create a empty gameObject and make the capsule a child of the empty.
then rotate the capsule 90 degrees. and remove the script from the capsule and add it to the empty
Your answer
Follow this Question
Related Questions
Rotating Object on its Local World Axis 4 Answers
Making a specific axis look at an object 2 Answers
LookAt something while rotating on z? 1 Answer
LookAt on one axis 2 Answers