Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


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

valueA

Friction or bounciness value used by one Collider2D.

valueB

Friction or bounciness value used by another Collider2D.

materialCombineA

The combined mode used by one Collider2D.

materialCombineB

The combined mode used by another Collider2D.

Returns

Type

Description

floatThe 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.