GetCombinedValues(float, float, PhysicsMaterialCombine2D, PhysicsMaterialCombine2D)
Calculates the effective value used when two Collider2D come into contact with their own PhysicsMaterial2D.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.Physics2DModule
public static float GetCombinedValues(float valueA, float valueB, PhysicsMaterialCombine2D materialCombineA, PhysicsMaterialCombine2D materialCombineB)
Parameters
Friction or bounciness value used by one Collider2D.
Friction or bounciness value used by another Collider2D.
The combined mode used by one Collider2D.
The combined mode used by another Collider2D.
Returns
Type | Description |
|---|---|
| float | The effective friction or bounciness value used in the collision response. |
Remarks
You can use this method to determine the exact friction or bounciness value applied when two Collider2D come into contact.