0
\$\begingroup\$

I'm trying to create a ball that exhibits perfect elastic collisions, meaning it should bounce infinitely without losing energy.

Here's what I've done so far:

  • Set the ball's restitution to 1
  • Set friction to 0
  • Set angular and linear damping to 0
  • Enabled physics substepping
  • Set restitution combine mode to Max
  • Set friction combine mode to Min
  • Ball and floor have same physical material

Despite these settings, the ball still loses energy and doesn't bounce infinitely. What could I be missing or doing wrong? Is there another setting I need to adjust, or is there a limitation in UE5's physics engine that prevents this from happening?

\$\endgroup\$
3
  • \$\begingroup\$ Generally game.physics engines prioritize speed of processing over perfect physical simulation, and they're limited by the precision of their number formats, which will lead to compounding errors from rounding. If you want perfect elastic collision like in Pong or Breakout, a physics engine might not be the right tool for the job, and you might want to calculate your own perfectly elastic bounce trajectories (to within numeric precision) using things like spherecasts to detect the next collision plane. We can help if you can show what kind of environment this ball is bouncing in. \$\endgroup\$
    – DMGregory
    Commented Aug 17 at 9:23
  • \$\begingroup\$ @DMGregory Thanks, the ball is losing height much faster than what I'd expect from just floating-point precision errors - around 1% per bounce, which seems too high. I'm building a 2D simulation where users can place objects and constraints like springs, joints, etc., and then observe interactions. That's why I prefer to expose these features from engine to the user instead of implementing everything from scratch. I initially tried this in Godot 4, and the physics worked well, but I need to use Unreal Engine due to other features. \$\endgroup\$
    – B.G.
    Commented Aug 17 at 10:32
  • \$\begingroup\$ @DMGregory The Physics Simulation sub-step value as described by dev.epicgames.com/documentation/en-us/unreal-engine/… can exacerbate the precision errors exponentially from single step analysis. \$\endgroup\$
    – agone
    Commented Aug 21 at 22:29

1 Answer 1

0
\$\begingroup\$

The UE physics engine is designed for real world simulations.

You are asking it to ignore reality.

Physics equations involves both 0 and infinity and more importantly to your question the bounds are interchangeable. Since "1/" operations are commonly required.

The zero loss restitution value will be set to Epsilon to make reality work. This is the same replacement for infinity as the Max value.

This replacement does not occur for "Flubber" like values mathematically defined and valid computationally.

\$\endgroup\$

You must log in to answer this question.

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