I have a taller enemy with rigidbody, and a small character player,
the transform.LookAt(target) works fine but the enemy rotates y axis very low when i get very close,
i tried to freeze rotate on rigid body but nothing happened
Please help me i’m a just a beginner.
Need more information. What is wrong with checking the distance between them and disabling the lookAt call if they are to close?
What is your code trying to do? Can we see the code in question? Picture or video available if your having difficulty explaining.
here, the enemy is kinda facing low i need it to stand up or remain its y axis
Look at a few rotate functions in the reference like the following:
http://unity3d.com/support/documentation/ScriptReference/Transform.RotateAround.html
You want to save his original .transform.up value and make sure that up value is always up. A few functions take this into account (if that function doesn’t work, try a few others. Otherwise you can save his .up value and force it to always be that value manually (through an update) or create your own coroutine that only changes his eulerAngle.y axis would also work.
transform.LookAt (target);
transform.eulerAngles = new Vector3 (0, transform.eulerAngles.y, 0);