Constrain object rotation set by mouse?

i have a character, and attached to him is a little flamethrower particle effect. ive been using this script to point the particle effect in the direction the mouse is. the particle effect is childed to the character so it doesnt move unless he does. however it goes around 360 degrees around the player. i have played around with this script for quite a while now and i just cant figure it out. how can i constrain the rotation of the particle effect to say, 60 or 90 degrees infront of the player?

`````` var speed = 4.0;

function Update () {

var playerPlane = new Plane(Vector3.up, transform.position);

var ray = Camera.main.ScreenPointToRay (Input.mousePosition);

var hitdist = 0.0;

if (playerPlane.Raycast (ray, hitdist)) {

var targetPoint = ray.GetPoint(hitdist);

var targetRotation = Quaternion.LookRotation(targetPoint - transform.position);

transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, speed * Time.deltaTime);
}
}
``````

I suppose the simplest way would be to just check if the targetRotation exceeds your max rotation before setting it.

so something like this would go right after you set your targetRotation value.

``````//I'm just assuming 2D so I'm checking the z value
if(targetRotation.transform.eulerAngles.z > 90)
targetRotation.transform.eulerAngles.z = 90;

//Then the same sort of thing if less then 0
if(targetRotation.transform.eulerAngles.z < 0)
targetRotation.transform.eulerAngles.z = 0;

//And if your character flips directions you'll have to handle that too. otherwise now you just set it.
``````