- Home /
Third-person mouse based-movement is blocked by edges of screen?
Hello everyone,
My problem probably has a very simple answer but I really couldn't find anything around the web. Anyway, my problem is that I have a tank game where my mouse position in x determines where the turret of the tank is going to aim and that if my mouse reaches either edge of the screen, then the turret can't rotate anymore and I have to go back the other way until I reach either one of the edges again. I was trying to find a way to put my mouse in a "loop" when it reaches an edge, or to put it back to the center on every frame but the closest solution I found was to lock the cursor, but then the turret can never rotate since the mouse just stays in the middle.
I'm quite lost as to what I should do now, it's basically just a very annoying gameplay problem.
Thank you for your help!