I am confused by your logic. You do Get Control Rotation, clamp it and pass it again to Set Control Rotation. That would not change the current rotation at all (unless it is greater than 20 or less than -20).
What you have to do is Get Control Rotation, add a delta angle to it depending on your input (say 5 * Axis value), clamp the resulting angle between 20 and -20 so it never exceeds those value, then pass it to Set Control Rotation.
Take it step by step. First make sure your input does rotate the maze. Then add the part that clamps the angle so the rotation stays within [+20,-20]. Start simple and add complexity as you go.
I set up a maze game with the maze as the player pawn. The twin stick controls will rotate the maze, causing the ball to move in the given direction (via gravity). I hit a road block when trying to set up the rotation, however. Here is a screen of my maze as well as the current (unworking bp). I want to clamp the angle of movement at 20 degrees in any direction. How do I set this up properly?
Yes, my logic is flawed. I’ve been scouring forums to try to find the right setup. This was one of the examples that someone claimed to work. It does not. Thanks. I will try what you said.
A question I should have asked earlier: does your maze actor have a movement component in it? If not, Set Control Rotation would not rotate it. You need to use SetActorRotation and act on the Roll or Pitch component depending on how your maze is oriented.
Then you have to double check your input events because they don’t seem to be firing. Use Print String to output a debug message to the screen immediately after each input event. When you press your input keys you see the message come up. Then you know your inputs are working properly…
Next call SetActorRotation from the input event pasing a standard angle to it, say 20 degrees. If your actor has 0 rotation, it should go to 20 when you press the input key. If it still doesn’t rotate, then check that you haven’t setup any constraints to it.
If you want to clamp a local player’s rotation, you can use SetViewPitch(Yaw/Roll)Max/SetViewPitchMin via GetPlayerCameraManger node.
InputAxis and it’s Axis Value should linked to AddControllerYawInput node. The InputAxis is just a keyboard event, we need to tell the input value to the controller, and the controller will update actor rotation every frame.