Hi!
I am currently developing a VR game that will include a minigolf minigame. Though, I am having trouble figuring out how to create realistic golf ball physics.
In a minigolf game it’s important to have good and consistent wall bouncing physics, so that the player can more easily predict where the ball will go, and try to line up difficult shots. However, I am having inconsistencies where the ball will either bounce like it’s supposed to, or just stick to the wall and start moving parallel to it.
Right now I am trying to use a physics material with a high restitution value. It works good for vertical bouncing, but sometimes won’t bounce against walls.
I included a video to show what’s happening more clearly. In the video the restitution it turned all the way up, and one ball starts in the air to show that vertical bouncing works correctly.
Anyone know how I might be able to fix the wall bouncing? Thanks!
Unfortunately these didn’t work, but I appreciate the answer!
Getting predictable results from the physics engine is pretty hard. A few things I can think of that might help.
- See what happens when you change the mass off the ball.
- Make sure you’re setting the physics material on the wall + floor + ball.
- Try enabling CCD (Continuous Collision Detection) on the balls.
- Try locking the rotation of the ball + reducing friction. or
- Try changing angular damping on the ball to reduce the amount it can spin.
I managed to find the solution
I went to project settings > physics and then changed the Bounce Threshold Velocity to a low number. This allows objects to bounce even if they are traveling slowly, rather than just stick to the wall
I wouldn’t recommend setting this too low or to 0, because I imagine it could cause some lag if too many objects are able to bounce continuously.