- Home /
Getting realistic bounces using physics materials.
Hi,
Im trying to set up am object spawning gun to fire spheres that will then bounce off all the walls accurately.
Unfortunately, if the angle is any more mild than about 70 degrees, the ball just slides along the wall that it has collided with.
The settings of the wall and projectiles physics material are...
-- Bounce on 1 all frictions on 0.#
-- 1 mass, 0 drag and no gravity or Kine.
Can anyone please suggest a solution, or alternative.
Thanks, - Graeme.
EDIT: Additional info.
" I should probably mention though that I'm trying to simulate ball physics like these - tanktrouble.com - I think the problem is that when the angle gets to low, the physics think it should roll across the surface instead of bouncing away at the correct angle. so what I really need is a solution to get my ball physics down to pure bounce, for total reflection of the initial angle - Any suggestions please? Thanks "
Answer by Jason B · Apr 16, 2011 at 11:47 PM
All frictions are too low, that's probably your problem right there. It's a pretty common question people ask, wondering why their ball slides instead of rolls. :)
Set your dynamic frictions to 1 and see how that affects things. Go down from there if you need it to not be 1.
Thanks so much for the suggestion, I should probably mention though that I'm trying to simulate ball physics like these - http://www.tanktrouble.com/ - I think the problem is that when the angle gets to low, the physics think it should roll across the surface ins$$anonymous$$d of bouncing away at the correct angle. so what I really need is a solution to get my ball physics down to pure bounce, for total reflection of the initial angle - Any suggestions please?
Thanks
Ah, okay. Well then, you need to set your Bounciness of the physics material to something more. $$anonymous$$eep in $$anonymous$$d that a bounciness of 1 means that however much force you strike an object at, the exact opposite amount of force will be applied back. If you have a rigidbody with no damping and a bounciness of 1 (and a bounce combine of $$anonymous$$aximum), it would theoretically bounce forever. $$anonymous$$eep your friction high (to avoid sliding) and set the bounciness high (so it will bounce). If the bounciness isn't strong enough, consider changing to $$anonymous$$aximum.
The default of Average will mean that if your ball (with a bounce of 1) and, say, a wall (with a bounce of 0) collides, the real bounce will have a strength of 0.5 (the average between the two), and thus the ball will rebound with half the energy it impacted at. In order to make projectiles bounce (I guess? Didn't play it much) forever as in TankTrouble, you might want to ensure there is no movement damping so the projectile never slows down.
I think i tried every variation, but i'l try again to make sure. Thanks a bunch for the help, really appreciate people being so helpful on this site.
Answer by vaxushti · Sep 19, 2019 at 10:05 AM
Pool balls have a very high elasticity, so you should set your bounciness at close to 1. They also have very low Friction, so both static and dynamic should be set at close to 0.
I'm less certain about pool tables however. They probably have pretty low friction and bounciness, both around the range of 0.1-0.3 if I were to guess.
Answer by ExNinja · Mar 01, 2018 at 11:03 PM
Because this comes up in searches for example Physics Materials, here are the original Bouncy, Ice, MaxFriction, Metal, Rubber, Wood, and ZeroFriction from Unity:
http://exninja.com/files/PhysicsMaterials_From_Standard_Assets.unitypackage
Your answer
Follow this Question
Related Questions
Cant find options to change physic material to bouncy 2 Answers
Physical Material causes wrong direction at bouncing 0 Answers
Reducing bounce on simple boxes 0 Answers
How do you keep a bouncing ball from "breaking" through cloth 1 Answer
how to change physics material of a colider in runtime 5 Answers