I’ve created a system that moves my camera depending on the mouse position. It is an RTS game. For some weird reason, whenever the mouse is outside of the viewport, the camera starts to move to one of the set directions (one of the if-s statements is activated).
I tried to launch my game in standalone viewport, and camera started to move with no stopping, so I tried to lock my mouse to the viewport and set it to the middle of it (so the camera shouldn’t move once game starts).
In my GameMode.cpp I added a Begin Play() function, so I can set the location and lock: