Reputation: 350
currently I'm trying to create a life-like ping pong ball in Unity.
So far, no problem. I assigned a rigidbody and a sphere-collider. The sphere-collider got a material, on which I set the bounciness to 0.85 (apparently about the value a ping pong ball has on a standard solid floor).
The ball bounces fine so far, but when it is about to come to rest, that is where the problems kick in.
Initially, the ball would bounce lower and lower / faster and faster, until it finally "snapped" to the ground (missing out the last few bounces one would expect to see).
I read that this is because of the "bounce threshold" in the physics settings. I think the default value was 2.0, so I changed it to 0.6.
Now the ball does not get snapped to the ground, but instead won't stop bouncing at all from this last small height.
You can probably refer from this picture, the height where the balls keep bouncing on (scale of the balls should be pretty acurate to Unitys metric scale system)
I don't actually get why this is the case, since the bounciness is already set to 0.85, shouldn't it lower it's height by 15% every bounce?
Additional info: I already tried a few thing, give the floor a physics material too, with bounciness set to 0, adjust the friction parameters etc. but nothing seemed to have any effect on this.
How can I accomplish life-like last bounces of the ball, and let it come to rest more naturally?
Any help would be greatly appreciated.
Thanks in advance & best regards,
LilaQ
Upvotes: 4
Views: 7008
Reputation: 11
I Exactly had this problem , but lowering the fixed timestep value does not solve my problem , I changed Drag value to 1 in rigid body componenet and my problem solved.
Upvotes: 1
Reputation: 378
You can try lowering the Fixed Timestep value in Edit->Project Settings->Time. This will increase the accuracy of the physics simulation. For example, with a bounce threshold of 0.6, a fixed timestep of 0.005 let my test ball eventually come to rest.
Upvotes: 6