I’ve encountered a bit of a frustrating issue that I’ve been unable to solve properly and could use some help.
The issue (see linked .gif to get an idea of what I’m talking about):
When applying X velocity to an arcade body standing near the edge of a platform (with velocity being towards the center of the platform) the dynamic body is sometimes “thrown off” the edge in the opposite direction. I don’t know enough about the workings of arcade physics, but what it looks like is happening is that the body registers as colliding with the platform underneath it and it’s “adjusted” so that it’s no longer overlappping.
Here’s what it looks like: https://imgur.com/a/M7RGTAS
Some more details:
-
The player here is just an arcade sprite (you can ignore the small ‘inner debug-bounds’, should be unrelated but forgot too remove it).
-
The ground is a static tilemap layer
-
Collision through adding a collider, e.g this.physics.add.collider(player, staticTilemapLayer)
-
Other than the X velocity being applied, Y-gravity should be the only force applied
Phaser version: 3.19.0 (but issue existed for at least a few versions back as well)
Running on chrome v.77.0
And, most importantly: I’m only able to reproduce the issue when chrome is eating up a lot of resources, so if I’ve got like a bunch of tabs open with streams / videos etc. It’s also been reported by some players to happen under not so stressful circumstances but I’m not sure what hardware they’re running on, so they could be running it on potato-machines.
So… anyone has any ideas of how this can be solved / worked around? I’m not sure if’s a bug or just a limitation with arcade physics