How do i lock Z (yaw) rotation for static mesh in BP actor when reached certain Z (yaw) number?

I have this problem that I don’t know how to lock rotatation object when f.e Z (yaw) for object that reached -30 and 130. How do I do this?

What is worth noting is that my blueprint contains a function for moving the object (“it’s just a door from electric panel”) based on mouse movements.

Hey @Neyvinwastaken! Welcome to the forums!

The node you’ll want to use is called “Clamp” of the given variety you need, likely “Clamp float” and have that go into the Z of the rotator. But I can’t safely say that because we don’t know what your code looks like! :stuck_out_tongue: Go get a screenshot of the rotation code and we can figure it out pretty easily from there! :slight_smile:

Sure, here you go.

Opening Electric panel door posted by anonymous | blueprintUE | PasteBin For Unreal Engine - It’s my code for opening electric panel door (i don’t know exact translation) by mouse movement

Hey again!

So the thing is, “AddRotation” Can’t react to clamps. You could try doing something like this:

Keep in mind, Relative is parent-based, local is self-based.

But you need to use a SET somewhere, not an ADD. Maybe add a check before the add rotation to make sure “Z > minimum value AND Z < Maximum value” before adding the rotation, and then on the false check
“IF Z < Minimum value, set rotation z to minimum value” and
“IF Z > Maximum value, set rotation z to Maximum value”. So if it overshoots, it corrects itself. :slight_smile: