Description
The RigidbodyFlags
property of the Rigidbody
class in the Sandbox API is used to define various flags that control the behavior of a rigid body in the physics simulation. These flags can be used to customize how the rigid body interacts with the physics world, such as enabling or disabling certain features or behaviors.
Usage
To use the RigidbodyFlags
property, you can set it to a combination of flags from the RigidbodyFlags
enumeration. This allows you to configure the rigid body's behavior according to your needs. The property is marked with the PropertyAttribute
and MakeDirtyAttribute
, indicating that changes to this property will be tracked and may require the physics engine to update its state.
Example
// Example of setting RigidbodyFlags
Rigidbody myRigidbody = new Rigidbody();
myRigidbody.RigidbodyFlags = RigidbodyFlags.DisableGravity | RigidbodyFlags.Kinematic;
// This sets the rigid body to be kinematic and disables gravity for it.