Top down Camera Rotation with E, Q (not in steps but dynamic)

HI I am new to using UE and have been trying to figure out how to make a topdown camera rotate while a button is pressed

I have been able to make a camera rotate in fixed intervals such as 90degrees etc… but what I would like is a way to rotate the camera while the button is pressed so for example
rotate +z when holding E, then -z when holding Q
I have tried using a few things like while loops (Crash) none of it seems to be working as expected…
I have been able to bind the zoom to the scroll wheel.

long run the goal is to be able to

  • zoom in/out with scroll wheel (working)
  • dynamically rotate world rotate camera/spring arm (in Z +/-) while a button is pressed

If you go into project settings, under the “Engine” category, click on “input” and add a new axis mapping. Call that axis mapping in your blueprint and use the node “add local rotation”. When you have the rotation node, right click the purple rotate variable built into the node and split it. Once that is done plug the float from the mapping input into the “Z” float in the rotation.

The input should look something like this:

And the Blueprint should look like this:

ended up binding it to the spring arm vs the camera to get it to rotate around the actor vs spin in place, but that is far simpler than what I was trying, so far what I have is this I am open to improvements etc…

1 Like

I am open to improvements etc…

Add interpolation so it’s more buttery?

Why not just use the camera lag, since it’s built into the spring arm?

You absolutely can providing you’re happy with what it does. But sometimes…

  • you want to interpolate a single axis only
  • you want to sample your own curves
  • you’re not too happy with what the collision probe is doing
  • you simply want a bit more control
  • you want a lot more control so you move the whole lot to the camera manager class
  • you want a non-standard behaviour because you’re dealing with something more unique
  • you may want to switch between the cameras and the built-in lag will not behave the way you want
  • you just want to experiment

You asked for improvements. The above can be a necessity, an improvement, a sideprovement or be plain redundant.

That’s true. I think I’ll be doing that from now on!