Version: 2023.2
LanguageEnglish
  • C#

Physics.defaultSolverIterations

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static int defaultSolverIterations;

Description

The defaultSolverIterations determines how accurately Rigidbody joints and collision contacts are resolved. (default 6). Must be positive.

If you are having trouble with connected Rigidbodies oscillating and behaving erratically setting a higher solver iteration count may improve their stability (but is slower).

This value is usually changed in Edit->Project Settings->Physics inspector instead of from scripts.

Note: Changing the defaultSolverIterations does not affect already created Rigidbodies. To change an existing Rigidbody please use Rigidbody.solverIterations.

Additional resources: Physics.defaultSolverVelocityIterations.

using UnityEngine;

public class Example : MonoBehaviour { void Start() { Physics.defaultSolverIterations = 10; } }