how to get my look at script to only work on the Y axis?

i’m using this script;

var LookAtTarget:Transform;

var damp = 6.0;

var savedTime=0;

function Update ()

{

if(LookAtTarget)

{

	var rotate = Quaternion.LookRotation(LookAtTarget.position - transform.position);
	
	transform.rotation = Quaternion.Slerp(transform.rotation, rotate, Time.deltaTime * damp);
	
	var seconds : int = Time.time;
	var oddeven = (seconds % 2);
	
}

}

and i want for it to only work on the Y axis not X and Z…

thanks for your time!

This is a ‘frequently asked question’ :slight_smile: A search for ‘look at y only’ turns up (among others), this thread, which should give you the answer you’re looking for.