- Home /
transform.LookAt gives a twist
Hello, I have been botherd by a problem lately wich I could not find a solution to. Ive modelled my character with 3ds max... Boned it (RIGGED) and got it to move with some animations. In unity ive got the upper part of the body seperated from the left and right legs. The upper part is called "Hands" and I have used it to aim at the mouse position at all time... Now, the game is a side scroller shooter and the rifle should be aimin at the mouse. For some reason it makes a twist and THEN aims at the mouse position... The whole upper body is turned to the left and then aims at the mouse position.. but from a very silly twist and by a wrong axis... How do I fix my transform.LookAt?
Does it mean your guy is looking left when the mouse is to the right? (huh-huh he "boned" the character huh-huh (Butt-Head style)).
Answer by FatWednesday · Sep 07, 2012 at 03:19 PM
sounds like you might need to provide your LookAt with an up vector to stop the twisting long the look direction?
however if thats no it then sorry for repeating what you've tried :P
Answer by lodendsg · Sep 06, 2012 at 08:49 AM
Im working on a top down my self and had to toy around with rotation the post here might have some information for you it talks about zeroing a rotation i.e. to level out but also has rotation code in in it as well as a link to another post on a similar topic http://answers.unity3d.com/questions/312019/set-certain-axis-of-rotation-to-0.html
Your answer
Follow this Question
Related Questions
Third person animation 0 Answers
Object Look At Mouse 2 Answers
troubles with look at mouse script 2 Answers
transform.LookAt boundaries 1 Answer
Mouse Pointer Transform.Position? 1 Answer