Hi guys,
Please Help Me How to Limit the Rotation while i’m using Torque.
Thanks and Advance.
Hi guys,
Please Help Me How to Limit the Rotation while i’m using Torque.
Thanks and Advance.
I’m not sure about Toque specifically, but you can limit euler rotation easily in your update function.
void LateUpdate()
{
transform.eulerAngles = new Vector3(Mathf.Clamp(transform.eulerAngles.x,0,20),transform.eulerAngles.y,transform.eulerAngles.z);
}
That being said, this is a very hacky way to limit your rotation, and you should consider reassesing what it is you are limiting, and why, so that you can find a more eloquant method.