bounceIterations
The number of bounce passes the world runs each simulation step, after contacts and joints have been solved. Each pass pushes apart the bodies of every contact that struck with a bounciness above zero, at the speed its bounciness allows, and never adds energy. More passes let a bounce settle more accurately, which reduces unwanted spinning of bouncing boxes, and each pass adds work for every bouncy contact in the world. The value must be from zero up to the maximum bounce pass count. With zero, contacts never bounce whatever their bounciness.
Read time 1 minuteLast updated a day ago
Definition
- Type: Property
- Namespace: Unity.U2D.Physics
- Assembly: UnityEngine.PhysicsCore2DModule
public int bounceIterations { get; set; }
Remarks
The maximum bounce pass count is PhysicsConstants.MaxBounceIterations. Setting a value outside zero to that maximum logs a warning and leaves the current value unchanged. See _bouncePropagation and _bounciness.