Trying to rotate an object as long as a key is held

I’m trying to rotate the object that a top down camera is attached to so that when one key is held down it rotates one way and when a different key is held it rotates the other way. I’ve managed to get the rotation to occur when the either of the keys are pressed but the rotation only occurs once instead of continuously and when the key is released the rotation is reset

[Here’s a video showing the issue][2]

Edit: updated the blueprint picture

that sequence node will never be executed like that because it does not have an entry from tick.

plug tick in sequence. then connect then 0 to first gate and then 1 to second gate

I had disconnected the event tick from the sequence because I thought that it might have been preventing it from working properly. The original problem occurs either way

The GetActorRotation returns the rotation of the root component of the actor, however the SetActorRotation sets the rotation of the actor, not the root component. So I guess you are never changing the rotation of the root component, and adding to it every frame, so the new rotation value essentially stays the same. Try to set and get the rotation of the root component directly instead of the actor. (If this is the problem, then these nodes are have a serious naming problem)

Following your advice I went to the Blueprint reference section of the documentation to find out what node would actually adjust the root component directly. This ended up being the SetActorRelativeRotation node. I tried this node and just about every other node that had something to do with rotation, but none of them fixed the issue

You can manipulate the root component by using the GetRootComponent node of the actor and then using get/setWorldRotation.

I hadn’t thought of that, but after trying it the problem still persists.
I’ve added a link to a video showing the problem above

This one is actually rather simple.

For starters, you need to have your camera and object you are rotating part of a Pawn blueprint like so:

Than in the project settings create a new input for “Turn”

Finally add world rotation using the new “Turn” event that gets created when you make the inputs in the project settings:

If you haven’t already, make a game mode with the Default Pawn Class set to your new pawn, and in the world settings change the GameMode Override to your new game mode.

Thank you. I’ve been looking for a solution to a similar issue for a few weeks.