Rigidbody
7/14/25About 3 min
Rigidbody
Info
Rigidbody inherits from [Component](/docs/create/lua/API/Component/index.html)
Control of an object's position through physics simulation. Unity Rigidbody
Members
Properties
| Name | Description | 
|---|---|
Rigidbody.angularDrag | The angular drag of the object. | 
Rigidbody.angularVelocity | The angular velocity vector of the rigidbody measured in radians per second. | 
Rigidbody.centerOfMass | The center of mass relative to the transform's origin. | 
Rigidbody.collisionDetectionMode | The Rigidbody's collision detection mode. | 
Rigidbody.constraints | Controls which degrees of freedom are allowed for the simulation of this Rigidbody. | 
Rigidbody.detectCollisions | Should collision detection be enabled? (By default always enabled). | 
Rigidbody.drag | The drag of the object. | 
Rigidbody.freezeRotation | Controls whether physics will change the rotation of the object. | 
Rigidbody.inertiaTensor | The diagonal inertia tensor of mass relative to the center of mass. | 
Rigidbody.inertiaTensorRotation | The rotation of the inertia tensor. | 
Rigidbody.interpolation | Interpolation allows you to smooth out the effect of running physics at a fixed frame rate. | 
Rigidbody.isKinematic | Controls whether physics affects the rigidbody. | 
Rigidbody.mass | The mass of the rigidbody. | 
Rigidbody.maxAngularVelocity | The maximimum angular velocity of the rigidbody measured in radians per second. (Default 7) range [0, infinity]. | 
Rigidbody.maxDepenetrationVelocity | Maximum velocity of a rigidbody when moving out of penetrating state. | 
Rigidbody.position | The position of the rigidbody. | 
Rigidbody.rotation | The rotation of the Rigidbody. | 
Rigidbody.sleepThreshold | The mass-normalized energy threshold, below which objects start going to sleep. | 
Rigidbody.solverIterations | The solverIterations determines how accurately Rigidbody joints and collision contacts are resolved. Overrides Physics.defaultSolverIterations. Must be positive. | 
Rigidbody.solverVelocityIterations | The solverVelocityIterations affects how how accurately Rigidbody joints and collision contacts are resolved. Overrides Physics.defaultSolverVelocityIterations. Must be positive. | 
Rigidbody.useGravity | Controls whether gravity affects this rigidbody. | 
Rigidbody.velocity | The velocity vector of the rigidbody. It represents the rate of change of Rigidbody position. | 
Rigidbody.worldCenterOfMass | The center of mass of the rigidbody in world space (Read Only). | 
Methods
| Name | Description | 
|---|---|
Rigidbody.AddExplosionForce(explosionForce, explosionPosition, explosionRadius, upwardsModifier=0, mode=ForceMode.Force) | Applies a force to a rigidbody that simulates explosion effects. | 
Rigidbody.AddForce(force, mode=ForceMode.Force) | Adds a force to the Rigidbody. | 
Rigidbody.AddForceAtPosition(force, position, mode=ForceMode.Force) | Applies force at position. As a result this will apply a torque and force on the object. | 
Rigidbody.AddRelativeForce(force, mode=ForceMode.Force) | Adds a force to the rigidbody relative to its coordinate system. | 
Rigidbody.AddRelativeTorque(torque, mode=ForceMode.Force) | Adds a torque to the rigidbody relative to its coordinate system. | 
Rigidbody.AddTorque(torque, mode=ForceMode.Force) | Adds a torque to the rigidbody. | 
Rigidbody.ClosestPointOnBounds(position) | The closest point to the bounding box of the attached colliders. | 
Rigidbody.GetPointVelocity(worldPoint) | The velocity of the rigidbody at the point worldPoint in global space. | 
Rigidbody.GetRelativePointVelocity(relativePoint) | The velocity relative to the rigidbody at the point relativePoint. | 
Rigidbody.IsSleeping() | Is the rigidbody sleeping? | 
Rigidbody.MovePosition(position) | Moves the kinematic Rigidbody towards position. | 
Rigidbody.MoveRotation(rot) | Rotates the rigidbody to rotation. | 
Rigidbody.ResetCenterOfMass() | Reset the center of mass of the rigidbody. | 
Rigidbody.ResetInertiaTensor() | Reset the inertia tensor value and rotation. | 
Rigidbody.SetDensity(density) | Sets the mass based on the attached colliders assuming a constant density. | 
Rigidbody.Sleep() | Forces a rigidbody to sleep at least one frame. | 
Rigidbody.SweepTest(direction, maxDistance=math.huge, queryTriggerInteraction=QueryTriggerInteraction.UseGlobal) | Tests if a rigidbody would collide with anything, if it was moved through the Scene. | 
Rigidbody.SweepTestAll(direction, maxDistance=math.huge, queryTriggerInteraction=QueryTriggerInteraction.UseGlobal) | Like Rigidbody.SweepTest, but returns all hits. | 
Rigidbody.WakeUp() | Forces a rigidbody to wake up. | 
Inherited Members
Inherited Properties
| Name | Description | 
|---|---|
Rigidbody.gameObject | The game object this component is attached to. A component is always attached to a game object. | 
Rigidbody.tag | The tag of this game object. | 
Rigidbody.transform | The Transform attached to this GameObject. | 
Rigidbody.hideFlags | Should the object be hidden, saved with the Scene or modifiable by the user? | 
Rigidbody.name | The name of the object. | 
Inherited Methods
| Name | Description | 
|---|---|
Rigidbody.BroadcastMessage(methodName, parameter=nil) | Calls the method named methodName on every Lua Script in this game object or any of its children. | 
Rigidbody.CompareTag(tag) | Is this game object tagged with tag ? | 
Rigidbody.GetAllLuaScripts() | Returns an array of all Lua scripts that attached to the game object. | 
Rigidbody.GetComponent(type) | Returns the component of Type type if the game object has one attached, nil if it doesn't. | 
Rigidbody.GetComponentInChildren(t) | Returns the component of Type type in the GameObject or any of its children using depth first search. | 
Rigidbody.GetComponentInParent(t) | Returns the component of Type type in the GameObject or any of its parents. | 
Rigidbody.GetComponents(type) | Returns all components of Type type in the GameObject. | 
Rigidbody.GetComponentsInChildren(t) | Returns all components of Type type in the GameObject or any of its children. | 
Rigidbody.GetComponentsInParent(t) | Returns all components of Type type in the GameObject or any of its parents. | 
Rigidbody.SendMessage(methodName, value=nil) | Calls the method named methodName on every Lua Script in this game object. | 
Rigidbody.SendMessageUpwards(methodName, value=nil) | Calls the method named methodName on every LuaScript in this game object and on every ancestor of the behaviour. | 
Rigidbody.TryGetComponent(type) | Gets the component of the specified type, if it exists. | 
Rigidbody.GetInstanceID() | Returns the instance id of the object. | 

