|
Hello I have this script but I only want the object to rotate on the Y-Axis can someone help?
(comments are locked)
|
|
Calculate the direction vector and zero its y component - this makes the direction strictly horizontal: var dir = target.position - transform.position; dir.y = 0; // kill height differences transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(dir), rotationSpeed * Time.deltaTime); awesome works great thanks.
Dec 01 '11 at 10:41 PM
Aydan
(comments are locked)
|
