1
\$\begingroup\$

I'm trying to do a very simple ball bouncing setup in Unity. I have a sphere with a sphere collider and a plane below it was a rectangular mesh on it, isTrigger set to false for both, and they both have a physics material with bounciness of 1. I have the ball start a couple units above the plane, gravity pulls it down, but instead of bouncing it stops right at the collider for the plane, then (weirdly) slowly falls through the collider. Once it falls through the bottom it starts falling normally again. The collider is already really thick (I've been trying to fix this by changing collider types and making them way bigger than needed). I just have no clue what's going on and feel like I'm missing something obvious.

\$\endgroup\$
1
  • \$\begingroup\$ How are you moving your ball? Just with a Rigidbody or do you have another script attached too? Can you show us the inspector setup of the ball and the plane? \$\endgroup\$
    – DMGregory
    Jul 17, 2019 at 12:02

2 Answers 2

1
\$\begingroup\$

It would be more helpful if you post screen shot of the physics material setup. But i did a quick demo and it worked for me. Setup your physics material as:

  1. Take a sphere and a Cube with Sphere collider and box collider respectively with "isTrigger" set to false for both objects.
  2. Then I've created physics material and assigned it to the sphere collider.
  3. here is the Physics material setup: enter image description here

And its done....

I hope it Works for you....

If you have any question please let me know and i try to be as helpful as i can...

Cheers!

\$\endgroup\$
0
\$\begingroup\$

You have to set up your ball physics. It depends on 2 parameters:

  1. rigidBody.mass

  2. physicsMaterial.friction

Choose the right mass value for better moving results, and make a Physics Material in Assets and set the right friction to it in the inspector and assign it to your collider.

If you need some controlled or deterministic behaviour, you have to disable the rigidBody and write some physics code for it.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ This answer would be better if it described what "the right value" is or how to determine it. Also note that for scripted physics objects, you'll more often want to keep the rigid body active, just set to kinematic so your script is in control of its behaviour. \$\endgroup\$
    – DMGregory
    Aug 16, 2019 at 10:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .