I’ve been following this tutorial: https://www.youtube.com/watch?v=FYtLXR4-VZc
Basically, two Camera Components on a Player, one is tied to it and follows it around, the other is a top view that can be moved by moving the mouse on the screen edges.
It works fine but I wanted to expand on it, more specifically, give the top camera more movement abilities. I managed to have it zoom and pan, it was all working good… Except one thing:
When I move my mouse to, say, the top of the screen, the camera will move towards the same direction always, regardless of its rotation. This direction (let’s call it North for simplicity) matches the camera’s forward vector’s, so I suspect that’s why I’m having trouble.
So for example, if I don’t rotate my camera and move my mouse to the top of the screen, the camera will move forward, as expected.
But if I rotate my camera 90 degrees to the left, the “North” is now on my right. And then if I move my mouse up again, the camera will start moving to the right, and not forward, as I would like.
I’ve tried many things, with local offset, setting relative position instead of world position, I’ve tried different things to rotate the camera, nothing has worked.
It’s probably worth mentioning that the camera I’m using is a Camera Component, child of a spring arm, itself child of a pawn. I’ve also tried this with a camera pawn and got the same result.
There must be something I’m doing wrong. Can someone help me with this? What I would like is a camera that always move towards its relative direction. So, regardless of its rotation, a mouse moving to the top of the screen would move the camera forward, always.