defaultMaxDepenetrationVelocity
The maximum default velocity needed to move a Rigidbody's collider out of another collider's surface penetration. Must be positive.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Property
- Namespace: UnityEngine
- Assembly: UnityEngine.PhysicsModule
public static float defaultMaxDepenetrationVelocity { get; set; }
Remarks
This value is usually changed in inspector instead of from scripts.
Edit->Project Settings->Physics->Settings->Game ObjectNote: Very large values can introduce instability during collision detection; too small values might cause the collider depenetration to fail.
You can also set a maximum depenetration velocity for individual Rigidbodies via _maxDepenetrationVelocity.
Examples
using UnityEngine;public class Example : MonoBehaviour{ void Start() { // By default defaultMaxDepenetrationVelocity has a value of 10.0f Physics.defaultMaxDepenetrationVelocity = 5.0f; }}