Setting Max Rotation for an object?

Hello! I have a game where I want there to be a flashlight that follows the camera. I’m still very new and learning the module based scripting, so it may be simple, but I am still oblivious to a lot of the syntax and their functions. My question is: Is there a way to set up a max rotation on AddLocalRotation? Or is there a better way to go about this? Any help is greatly appreciated!

Here is a video example of what the issue I have is:

Not that i know of but after adding Rotation you can setRotation to the value you want as max if a Getrotation after the Addrotation exceeds it on the same tick.

If I use the SetRotation syntax, it doesn’t move. It only moves if I have it set to AddRotation. Maybe I don’t quite understand… could you show me what you mean?

The character doesn’t have a camera.

I would just attach the torch to the camera itself, that way you don’t need to worry about the rotation at all.

Try looking into using a clamp via blueprints

I mean you would SetRotation to the pawn’s PlayerController’s ControlRotation directly rather than adding to its local rotation, but that makes it follow so closely that you only see the flashlight from one angle. Is this what you meant when you said the flashlight doesn’t move?

Ahhh. Okay so you mean something like the attached screenshot. Okay. Alright! That worked! Thank you so much!