Ball won't bounce off walls correctly. (Sticks instead)

Barbacamanitu
Wed, 26 Oct 2016 11:03:15 +0000
World Creation

I’m trying to get a simple physics game working that uses a ball. The ball needs to bounce off walls realistically. However, when the ball approaches any wall at a relatively small angle, it just sticks to the wall instead of bouncing off.

Is there any possible way around this? When going head on at the wall, the ball will bounce. It will also bounce all the way up until around 20 degrees or so, depending on the velocity.

Edit: I wanted to clarify this question a bit more. Here is a quick drawing of the problem:

[Album] imgur.com

I need the case on the right to not happen anymore. If I had to guess, I’d say that the collision logic has a bug in it where it tells objects to not have any velocity other than parallel to the normal if it’s going slow enough.

I’ve already tried setting up physics materials, using projectile motion, and tons of other stuff. I’m considering just writing my own physics implementation of this, but I’d really rather not since I feel like this should be a part of such a big engine.

13 posts - 8 participants