Hi there,
i’ve been trying to create a system where the player possesses a camera that is static inside the 3d world, but and you see some ui on top of the 3d render. However, when your cursor gets close to the edge, the camera should move slightly towards that edge to give a better effect.
Gamer note: if someone ever played overwatch 2 what i’m referring is how the camera behaves when you’re winston seated in front of the computer and can select missions.
To achieve this, i created the following blueprint inside a playercontroller:
Basically, on init play i set a reference to the camera and set it as the current camera.
In the event tick, i check if the cursor is close to either of the 4 edges and lerp a 10-degree rotation offset in that direction.
Now this works really great, if you like looking up, down or left. Except when you try to look right and you’re met with the camera spinning around (in the wrong direction i suppose) with a terrible fast motion. The code is literally the same, just it’s +10 deg. and not -10 deg. (because you’re turning right, not left). I think i should also mention that when the camera is “at center” its world rotation is (0, -20, 180).
Do you have any idea why this happens?