Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

var sleepMode: RigidbodySleepMode2D;
sleepMode as RigidbodySleepMode2D

Description

The sleep state that the rigidbody will initially be in.

Sleeping is an optimisation that is used to temporarily remove an object from physics simulation when it is at rest. This property chooses whether the rigidbody should start off asleep, awake or have sleeping turned off altogether.

See the Physics Overview in the manual for more information about Rigidbody sleeping.

See Also: Sleep, IsSleeping, WakeUp, Rigidbody.Sleep.