I’m using a dynamic object to govern the ball physics of my little golf game. About 1 in 10 times the ball bounces off a horizontal surface, it bounces back the way it came rather than onward in the same horizontal direction:
Are the physics objects scaled to any extremes (e.g. using really small or really big values)? Are the forces involved really big/small? What collisions shapes are involved, box/capsules etc. or tile grid?
Tile maps use a box collisions shape for each tile if I’m not mistaken. I’m wondering if what happens is that the ball sometimes registered a collision with the side of a tile instead of the top of a neighbouring tile.
Is it easy to reproduce? Could you try running with debug physics enabled and see if any weird normal directions are in play?
What kind of physics scale do you have in game.project? I had many problems with glitches between tiles when implementing platformer physics and increasing the scale from what I had (I think it was like 0.02) made a big difference.
Since you are using a tilemap for the collision hull, could it be that it somehow “hits a corner” of a tile? (I’m not saying that it should be that way though, just wild guess, it might be a bug!)
@sven - it could be that. The tiles are solid blocks but depending on how the collision boxes interpret that, it could not be seeing a completely flat surface. Hard to tell!
I think @Mathias_Westerdahl noticed strange normals when colliding with tilemaps some time ago… Could you try just changing the ground to a long regular box shape, does it make a difference?
Could you try just changing the ground to a long regular box shape, does it make a difference?
No problems when I do that - the ball bounces as expected. Think you might be right with the idea of the ball hitting tile corners somehow, even though they’re lined up side-by-side.