How do i rotate an object towards a target on only y axis?

A quick way is to transform.LookAt(target) and then erase the x and z rotations. Assuming you want something like an RTS character than never leans over

```
void Update ()
{
// Look at including x and z leaning
transform.LookAt(target);
// Euler angles are easier to deal with. You could use Quaternions here also
// C# requires you to set the entire rotation variable. You can't set the individual x and z (UnityScript can), so you make a temp Vec3 and set it back
Vector3 eulerAngles = transform.rotation.eulerAngles;
eulerAngles.x = 0;
eulerAngles.z = 0;
// Set the altered rotation back
transform.rotation = Quaternion.Euler(eulerAngles);
}
```

transform.rotation = Quaternion.LookRotation (target.transform.position - transform.position);

transform.rotation = Quaternion.Euler(0, transform.rotation.eulerAngles.y, 0);

rotate towards player around world y:

```
float x = transform.rotation.eulerAngles.x;
float z = transform.rotation.eulerAngles.z;
Quaternion tempRotation = Quaternion.LookRotation(target.transform.position - transform.position);
transform.rotation = Quaternion.Euler(x, tempRotation.eulerAngles.y, z);
```

Transform.RotateAround

Without more info I cannot help you further.

```
var target : Transform;
// Rotate the Object every frame so it keeps looking at the target
function Update() {
transform.LookAt(target);
}
```

Dontâ€™t forget to mark the question as answered and give a possable thumbs up.

Also you could add constantForce.relativeForce = Vector3(0, 0, 1); to make the object move forward at a constant speed.