Description
The RigidbodyFlags
property of the Rigidbody
class in the Sandbox framework is used to define specific flags that control the behavior of the rigidbody component. These flags can be used to customize the physics interactions and properties of the rigidbody.
Usage
To use the RigidbodyFlags
property, you need to have a Rigidbody
component attached to a game object. You can then set or get the flags to modify the behavior of the rigidbody. This property is not static, so it must be accessed through an instance of a Rigidbody
.
Example
// Example of setting RigidbodyFlags
Rigidbody myRigidbody = new Rigidbody();
myRigidbody.RigidbodyFlags = RigidbodyFlags.Kinematic | RigidbodyFlags.DisableGravity;
// Example of getting RigidbodyFlags
RigidbodyFlags currentFlags = myRigidbody.RigidbodyFlags;
if ((currentFlags & RigidbodyFlags.Kinematic) != 0)
{
// The rigidbody is kinematic
}