Strange movement bug which happens randomly

Polybit

  • Posts: 2
Hello All,

I recently released a game and me and some of my users have discovered a randomly occurring movement glitch. I will attempt to describe the problem in detail and post the relevant code and perhaps one of you can see where the issue is potentially coming from.

Basically there is a vertical line going down the middle of the scene which is an actor that i'm using to simulate a gravitational pull towards the middle of the scene. In an always block in the scene i have told the ship to push itself towards the gravity line at a specified force.

The left and right movement of the ship is also in an always block, controlled by mouse down logic combined with x-speed. IF there is no mouse down, then it will slow itself down.

The problem is that sometimes the ship will randomly accelerate very quickly to the right side of the screen and stay there, stuck to the side. It feels to me like somehow it has gotten way too much x-speed somehow and suddenly the simulated gravity is no longer strong enough to bring it back towards the middle, and the slowing down of the ship while not touching the screen does not occur anymore.

I will attach all relevant code and a video of the error occurring and hopefully some of you have an idea. Thank you in advance for any help you may provide.