Hi. I have an object (turret) and i want it to look to the player. so i have this script:
var target : Transform;
function Update ()
{
var targetPoint = target.position;
var targetRotation = Quaternion.LookRotation (targetPoint - transform.position, Vector3.up);
transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime * 2.0);
}
but, i want it to only rotate Y…
how do i do that?