I have spent a few hours going through different pieces of code and have been unable to find anything that limits the rotation to just one axis.

This is what I have so far… explanation to follow.

```
void Update(){
if(gotTarget)
{
i += (speed * Time.deltaTime);
transform.rotation = Quaternion.Slerp(start, target, i);
if (transform.rotation == target)
{
i = 0f;
gotTarget = false;
fireMissile();
}
}
```

}

public void giveTarget(Vector3 pointIn){

if(!gotTarget)

{

gotTarget = true;

start = transform.rotation;

```
Ray r = Camera.main.ScreenPointToRay(pointIn);
point = r.origin;
point.z = transform.position.z;
target = Quaternion.LookRotation(point - transform.position);
}
```

}

the pointIn is mousePosition. transform.rotation == target is not working 100% at the moment.

the idea is when the object (a turret) is given an input, it will rotate around the Z to face the input position with its top (of a cylinder) smoothly using Lerp. when it reaches its final rotation, it will fire, then be ready for the next input.

however, the turret seems to be rotating through all angles in a peculiar way until.

i have uploaded a version to dropbox for the rotation to be seen. and you may see it not fire everytime as an if statement doesn’t always work.

https://dl.dropbox.com/u/34478950/Game/test/WebPlayer/WebPlayer.html

any help appreciated