Hello, I want to make the camera push around when the mouse moves close to the screen’s edge. Something like this
but without having to hold down click, if possible moving it smoothly. I have tried some youtube tutorials but I can’t get UE to manually detect the mouse and get the mouse delta to move the camera accordingly. Help would be appreciated
If you use controller rotation SetController rotation that should work too but if you just want on the edges think you have to calculate mouse position in screen first. You can access that too and upon reaching edges( if X< Number || X>Number) same for y-axis too do tick operation for rotation.
Since you want to control camera, the settings of how its setup really effects our logic. Sometimes we use options in pawn/camera/springarm → Use Controller Yaw/Pitch/Roll with UseControllerDesiredRotation. for different view models.
Like in 3rd person camera should act differently depending on gameplay and gameplay ux. I press forward, then back → Should my character pawn turn to controller side or not?
However we have to control camera to world interaction right? Like when this function should fire? If fired everytick it will always try turn on one side, is this something we want? etc. etc.
So I will just do things according to mouse pos, calculate a delta from center, check if its above some threshold and manipulate Controller Rot, which would work exactly like your video.
Since my character facing doesn’t change in capsule this time, I can just delta rotate spring arm. This is something more likelly you show since in the edges your camera stops as mouse delta, however both approaches are ok depending on what you do.
In the first & seconds videos its already like that.
In the third video if you are referring to; you can do with multiple ways.
A correct way is to create a curve and get its values. Especially if you want complete control over your numbers and movements. Here is a nice tutorial in depth explaining base fundamentals of working with curves.
A simpler more direct way is keep factor rotation very small and get a double power exponent to values making it n to the power scaling to infinity.