SimulationMode
A selection of modes that control when Unity executes the physics simulation.
Read time 1 minuteLast updated 5 days ago
Definition
- Type: Enum
- Namespace: UnityEngine
- Assembly: UnityEngine.PhysicsModule
public enum SimulationMode
Remarks
Additional Resources: Physics.simulationMode.
Examples
// SimulationMode.FixedUpdate is the default setting in Unity.// Attach this script to a gameObject and enter runtime mode.using UnityEngine;public class ManualPhysicsSimulation : MonoBehaviour{ void Start() { Debug.Log("Current Physics.simulationMode: " + Physics.simulationMode); }}
Fields
Value | Description |
|---|---|
| FixedUpdate | Use this enumeration to instruct Unity to execute the physics simulation immediately after the MonoBehaviour.FixedUpdate(). |
| Script | Use this enumeration to instruct Unity to execute the physics simulation manually when you call Physics.Simulate. |
| Update | Use this enumeration to instruct Unity to execute the physics simulation immediately after MonoBehaviour.Update(). |