- Home /
How do I reduce the bounciness of a ball affected by gravity in .js?
Hi guys,
(Please see the picture attached) This is a ball catcher. I am having a problem with balls with a velocity hitting the rigidbody of the catcher and flying back out. Is there a way that we can reduce the bounciness of the balls when they hit this?
There is an invisible trigger above the catcher which counts the score. I have tried attaching a "reduce velocity" function to this to no avail.
Any help would be greatly appreciated.
Thanks!
Answer by moghes · Jun 06, 2013 at 07:56 AM
When your balls enter the trigger , set the mass value to a higher value.
function OnTriggerEnter(other : Collider)
{
other.rigidbody.mass = 1000;
}
Note that 1000 is any number I suggested, test some values and comment what comes up with you.
that is a little weird. Just play with the Physic$$anonymous$$aterial
simply look at the doco page for "physicmaterial" to clearly see all the calls you can make in code.
Your answer
Follow this Question
Related Questions
Velocity powered rigidbody on a moving platform without parenting. 3 Answers
Rigidbody character controller can't walk on stairs 0 Answers
Character Joints and Animations results in strange physic animation 1 Answer
Gravitational Object Creation for 3D Game 1 Answer
2d side scrolling problem 5 Answers