How do I move camera with right mouse button ?

Only with blueprint it will be hard.
One thing would be:

Create a variable to store the old mouse position (Vector2D variable, let’s call it PreviousPosition)
Create a variable to store the actual mouse position (Vector2D variable, let’s call it NewPosition)

  1. Event: On mouse button pressed, set a bool variable (like “MovementOn”) to true, update PreviousPosition = NewPosition.
  2. Event: On mouse X/Y, update the target coords (update NewPosition).
  3. Event: Tick, if (MovementOn == true AND NewPosition - PreviousPosition > 0) then set the controller/camera location at: Controller.GetActorLocation + (MovementSpeed*(NewPosition - PreviousPosition) → To vector), update PreviousPosition = NewPosition.

Note that:
NewPosition - PreviousPosition > 0 you can use here a tollerance instead of 0
MovementSpeed is a float variable that modifies the amount of movement of the controller per screen unit.

instead of using the forumula i told (Controller.GetActorLocation + (MovementSpeed*(NewPosition - PreviousPosition) → To vector)
), you could trace PreviousPosition and NewPosition to the world, and apply the UU unit in the world difference, but it’s more expensive.

I am a total newb to game making, I have watched many videos.

I would like to be able to move the game camera with right mouse button, just like an ordinary RTS game.

I have searched for it everywhere but cant find how to do this.

I have managed to set up a new camera as the default starting one already, i just need movement! :stuck_out_tongue:

This is my level blueprint so far:

http://i.imgur.com/8XOuFMe.png

sorry iv no idea what youre talking about

Ok, for this time only, here you go :stuck_out_tongue:
You may need to change some little things, but basically it works.

Let me know if you have big problems (try to solve them first), and don’t forget to close the question :wink:

thank you for doing this :smiley: but i cant seem to find “SET (movement)”, where did you get that from xD ?

nearly all the set and get are on variables i created:
PreviousPosition and NewPosition are Vector2D
MovementOn is bool

haha i’ve just worked that out but where did you place them ? in the engine input section ?

You didn’t look at any blueprint tutorial at all, did you? Those are the basics :stuck_out_tongue_winking_eye:
This is all in the level blueprint, btw.

Remember to close the question :stuck_out_tongue_winking_eye:

okay thanks I get it now, i did do everything you did but the camera still stays still xD

http://i.imgur.com/KqrKwqa.png

http://i.imgur.com/v1mvyLV.png

mmmh maybe it’s because you set the controller as the view target (even if it seems strange).
Try gettin and setting the location on the controller instead of the pawn.
(the lower part of the last screenshot, remove “Get Player Pawn”, and use “Get Player Controller” instead

nah it didnt do anything :confused:

I tryied it myself, try to not execute the set view target (press alt+click on the white execution arrow to remove the link), and try again with the first system (moving the pawn)

ah ha you mean simulate from the drop down on the play button lol, progress atlast :stuck_out_tongue:
i wanted it to move side ways though, so you can skim across the map :stuck_out_tongue:

actually I think thats just the engine doing this, not that code. Since you can use every other button too to move about lol

In the editor, you can move using the mouse and dragging.
In game (or if you hit simulate), no. If that works, it’s the BP code.
If you need it to move on another axis, just change them.
Do you have at least some math notion? :stuck_out_tongue_winking_eye:

Anyway, you should seriously look at UE’s tutorials: A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums

So? did you get it?

Nah, it’s like i said the code does nothing, I will focus on other things for now… thanks for trying

I know this is old but if any buddy wanted to move them camera around with a mouse button click here is what i came up with after Zamy tried to help Dannyk90. thanks Zamy you helped me figure out what i was trying to do.

It may not be what the guy was looking for but it may help others trying to do the same thing i wanted. you can try and break the location and it might move the camera around the map but i haven’t tested it