Moving "topdown camera" with mouse input.

Hi!
I’m new to unreal engine 4, so I thought to start with something simple.
I got the idea to make a simple kind of “topdown 3d strategy game”, but I have problems with the camera moving.
I’ve placed the camera in a nice rotation angle, but I wan’t the player to be able to right-click and move the mouse to move the camera sideways, forward and backward and zoom with the scroll wheel (with the “level blueprint” system).
I can’t figure out what nodes I shall have and how I shall place them so that that’s possible (remember I’m new).
I’ve made a new function and then a timer in the “Event graph”, in which I’ve activated looping and sat the time to 0.001 second.

Best regards
TheDDestroyer12

EDIT: I’m not sure if anything that I’ve done is right!

  • Well first I would create my own Camera and use the Level Blueprint to “Set View Target with Blend” on Level Start to my own camera.

  • Second I would get a boolean if the Right Mouse Button was klicked

  • Every Tick I would check if that boolean is true and if so I would get the camera location and a node “Convert Mouse Location to World Space”, break the vector so camera just move in two directions and move or lerp the camera to the mouse position

  • For Scrolling I would lower the cameras z and clamp it to a min and a max value. I actually never did that but I don’t see why it shouldn’t work.

Hi!
I’ve changed my plans a little, so I wan’t the camera to rotate around a special point, like the middle of a sphere (a planet).
Is there any easy ways of changing the way you told me so that it rotates like that instead?
By the way, shall I keep the timer and set it to about 0.001 seconds and add the function for checking if RMB is down to it?

Sure.

  • On Event Begin Play change the camera to your custom camera with a Set View Target with Blend
  • Place a “Right Mouse Button” Block and add a boolean to both pressed and released (true for pressed and false for released)
  • add input for mouse move X or Y whatever direction you want that the camera spin if you move the mouse
  • add these events and connect them to a “Branch” Node and connect your boolean as a Condition input.
  • Get the “Add Actor Local Rotation” block and connect your camera and the branch.
  • experiment with the rotation vector (if your camera is looking down to the starting platform put a 1 into the x value and your camera will rotate around when pressing the right mouse button

I dont know or don’t understand what your timer is for, so I don’t know if you should keep it.

EDIT: Sorry. my fault…you should actually use the Input Mouse Event (1…-1…maybe multiplied by a constant) as the vector input for the “Add Actor Local Rotation” Input. Use a “Make Rot” Node to experiment with the x,y or z value…that depends what is up left and right in your setting. If you follow only the abbove your camera will only rotate in one direction.

This works if you add input in the project settings and if your camera is looking down the Z Axis.

1 Like

Flying Camera

Hi JOHIsaac! How about a camera like this: Domicile NUOVO Interactive Application on Vimeo

You move the camera (rotation / flying camera) as you click and grab the mouse pointer. Can you give me an idea?

Best regards!