- Home /
LookAt not working, points in wrong direction.
Hey, the box object here when the game isn't running;
heres the code; Gun.LookAt(Target); now, the target is a null object off the left of the screen, but when I play...
the 'gun' points out on the z axis when really all I want is rotation on the X axis, is it possible to do a transform.lookat in local space????
Please close, worked it out ..... :P silly me forgot to rotate the parent correctly....
Hi, to close it, simply reply to your own question with whyt you did, adn accept it (you'll need to wait 2 days I think before being eble to accept your own answer). Whatever is the "silly" miss, it's always useful.
Answer by Jason Hamilton · Apr 17, 2011 at 10:06 AM
The rotation of 'gun' is not the box but the null object that is the 'hand' of the player so the pivot point is correct. Insure that the rotation of the parents is correct. :D