x


Look Rotatein

this is the code of rotation of my monster but it turns 90 Degree more so how can i fix that?

var newRotation = Quaternion.LookRotation(_Char.transform.position - transform.position).eulerAngles;
 newRotation.y = 0;
     newRotation.z=0;
 transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(newRotation), Time.deltaTime);
more ▼

asked Jul 04 '12 at 09:27 AM

Exeed gravatar image

Exeed
345 1 12 22

Solved u can make an Empty Object then assign the script to it and rotate the enemy as want to be :D

Jul 04 '12 at 11:11 AM Exeed

If you have modeled enemy by yourself, I would rotate enemy model in modeller software.

Jul 04 '12 at 11:43 AM khellstr

you mean make sure the models axis are the same for both the modelling program and Unity ....

Another thing to check is if you have imported any animations with the model, turn them off or remove the animation component from the gameObject.

e.g. : http://answers.unity3d.com/questions/12732/Rotating-Objects-To-Face-Proper-Direction.html

Jul 04 '12 at 12:03 PM alucardj

Post your fix as an answer, then you can accept it. That would be helpful for future readers =]

Jul 04 '12 at 07:29 PM alucardj
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3418

asked: Jul 04 '12 at 09:27 AM

Seen: 127 times

Last Updated: Jul 04 '12 at 07:29 PM