How do I limit Rotations?

I am making a tank and i wanted to limit the rotation or the turret and the cannon. I know you can somehow clamp the rotation but Im not sure how to implemnet it correctly. Is anyone able to help me with how I go about doing that?

Theres an “RClamp” node iirc, but I’m not sure if it works with AddLocalRotation since youre feeding it a “delta” rotation rather than an “absolute” rotation (such as the input required by the setRotation functions).

That said, I suggest you just use the setRelativeRotation node to make sure RClamp is fully compatible. You just need to add the extra step of adding the product of your axisValue*turnRate to the turret’s current relative rotation.

I know this thread is 8 years ago, however if like me someone was looking for solution i blueprinted my solution below.

1 Like