class Rigidbody : Component

robot_2Generated
code_blocksInput

Description

The Rigidbody class in the Sandbox namespace is a component that adds physics properties to an object. It requires a collider to be attached to the same object to function properly. This class provides various methods and properties to manipulate the physical behavior of the object, such as applying forces, impulses, and managing velocity and mass properties.

Members

Properties

Member NameSummary
GravityIs gravity enabled or not.
LinearDampingControls the linear damping of the rigidbody.
AngularDampingControls the angular damping of the rigidbody.
MassOverrideOverride mass for this body, only when value is more than zero.
MassRead-only property representing the mass of the rigidbody.
OverrideMassCenterDetermines if the mass center is overridden.
MassCenterOverrideSpecifies the mass center override when enabled.
MassCenterCenter of mass for this rigidbody in local space coordinates.
LockingDefines the locking state of the rigidbody.
StartAsleepIndicates if the rigidbody starts asleep.
RigidbodyFlagsFlags that define the behavior of the rigidbody.
VelocityCurrent velocity of the rigidbody.
AngularVelocityCurrent angular velocity of the rigidbody.
MotionEnabledIndicates if motion is enabled for the rigidbody.
CollisionEventsEnabledEnable or disable touch events for collision detection.
CollisionUpdateEventsEnabledEnables OnCollisionUpdate events for persistent collisions.
SleepingIndicates if the rigidbody is currently sleeping.
PhysicsBodyGet the actual physics body created by this component.
TouchingList of all triggers that the rigidbody is touching.

Methods

Member NameSummary
FindClosestPointReturns the closest point to the given one between all convex shapes of this body.
GetVelocityAtPointReturns the world space velocity of a point of the object.
ApplyForceAtApplies force to this body at a given position.
ApplyForceApplies linear force to this body.
ApplyTorqueApplies angular velocity to this body.
ApplyImpulseAtApplies instant linear impulse to this body at a given position.
ApplyImpulseApplies instant linear impulse to this body.
ClearForcesClear accumulated linear forces during this physics frame.
SmoothMoveMoves the rigidbody smoothly to a target transform or position over time.
SmoothRotateRotates the rigidbody smoothly to a target rotation over time.