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)
Event: On mouse button pressed, set a bool variable (like “MovementOn”) to true, update PreviousPosition = NewPosition.
Event: On mouse X/Y, update the target coords (update NewPosition).
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.
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
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
i wanted it to move side ways though, so you can skim across the map
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?
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