2
\$\begingroup\$

I've got a ball rolling along a flat surface towards a wall. If the ball collides with the wall, it always bounces perpendicular to the wall, no matter what it's velocity before, instead of following the angle of reflection.

Here is the relevant information about the ball: Non-Kinematic Rigidbody Collisions set to Continuous Physic Material with 0.6 friction and 0.7 bounciness Combine Modes are both average

And the wall: Non-Kinematic Rigidbody Collisions set to Continuous Physic Material with 0.6 friction and 0.7 bounciness Combine Modes are both average

I can probably manually check for collisions and change the velocity along the angle using Vector3.reflect, but this should be something the Unity Physics engine handles if I can figure out how. Is there anything that can be done in-engine to get the bounce angles to set properly?

\$\endgroup\$
  • \$\begingroup\$ Can you provide a diagram of expected VS result? It's not clear what the angle of the surface is (do you mean "flat" surface as the shape, or as horizontally-flat [angle]?) --- The correct solution(s) depend(s) on the specifics of the problem. \$\endgroup\$ – XenoRo Dec 6 '17 at 3:15
  • \$\begingroup\$ Expected - Ball bounces and maintains momentum Observed - Ball bounces directly perpendicular to wall. \$\endgroup\$ – digiholic Dec 7 '17 at 4:46
1
\$\begingroup\$

Based on this question, try setting a lower friction value, and a higher bounciness.

\$\endgroup\$
  • \$\begingroup\$ Dropping the Friction does seem to help, but now it's taking entirely too long to slide to a stop. I think I'll just have to play with the forces and mass to try to find some sort of balance. \$\endgroup\$ – digiholic Dec 5 '17 at 0:35
  • 1
    \$\begingroup\$ The behavior is a combination of both. Friction affects the rotational forces and damping. Bounciness affects the energy transfer. Both variables of both objects contribute to the behavior. I'd keep the friction at maybe 0.5 and put the Bounciness to 1 and baseline from there. \$\endgroup\$ – Stephan Dec 5 '17 at 0:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.