Weird bounce reaction from dynamic object

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:

weird_bounce

Has anyone experienced this sort of issue and how did you resolve it? The problem’s happening just often enough that it’s likely to annoy the player.

Thanks!

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?

Here are the properties for the collision object for the ball. It uses a sphere shape.

The forces involved are small to moderate; I limited the top speed as the ball was getting stuck in walls at higher speeds.

The ball bounces around inside a tilemap. I’ve tried different sizes of ball and still get the same issue.

co

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?

Does appear there’s a normal momentarily pointing backward. Here’s a short video of that:

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!)

I’m using the following settings for physics. I’ll different combinations to see if that helps.

@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?

1 Like

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.