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\$
2
  • \$\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\$ Commented Dec 6, 2017 at 3:15
  • \$\begingroup\$ Expected - Ball bounces and maintains momentum Observed - Ball bounces directly perpendicular to wall. \$\endgroup\$
    – digiholic
    Commented Dec 7, 2017 at 4:46

1 Answer 1

1
\$\begingroup\$

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

\$\endgroup\$
2
  • \$\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
    Commented Dec 5, 2017 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
    Commented Dec 5, 2017 at 0:40

You must log in to answer this question.

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