• Studio

  • Studio API

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • Globals

    Rigidbody

    Inherits from:

    The Rigidbody component adds physical properties to an object, allowing it to react to forces and torques, making it controlled by the unity physics engine. If you want an object to be affected by gravity, for instance, or if you want to be able to apply forces to it, you would attach a Rigidbody component to it. Rigidbody also keeps track of the object's position and orientation.

    One common application of Rigidbodies is for creating objects that move and interact under physics control. On the other hand, you could also use Rigidbody for objects which move kinematically or which you want to move around the world but want to avoid intersection with other Rigidbodies. For a more detailed understanding, refer to the official Unity documentation.

    Properties

    The 'angularVelocity' property describes the angular velocity vector of the Rigidbody in degrees per second. Angular velocity essentially measures the rate and direction of rotation. When working on rotating objects or adjusting spin on Rigidbodies this becomes very handy. Unity's Rigidbody.angularVelocity Documentation

    automaticCenterOfMass

    boolean
    ClientOnly

    The 'automaticCenterOfMass' property determines whether the system should automatically compute the Rigidbody's center of mass. When this property is set to true, Unity calculates the center of mass based on the attached colliders. Unity's Rigidbody.automaticCenterOfMass Documentation

    automaticInertiaTensor

    boolean
    ClientOnly

    The 'automaticInertiaTensor' property enables or disables automatic calculations of the Rigidbody's inertia tensor based on its attached colliders. Disabling this allows setting custom inertia tensors, which can be beneficial for fine-tuning the rotational behavior of complex Rigidbody setups. Unity's Rigidbody.automaticInertiaTensor Documentation

    The 'centerOfMass' property helps manage Rigidbody's center of mass, a crucial factor in simulating physical behaviors. You can manually specify the local space position of the center of mass or let Unity automatically compute it. Unity's Rigidbody.centerOfMass Documentation

    detectCollisions

    boolean
    ClientOnly

    The 'detectCollisions' property gives you control over whether the Rigidbody will detect collisions or not. In some cases, you may want to move a Rigidbody through a scene without triggering hooks like OnCollisionEnter. In such situations, disabling detectCollisions can be helpful. Unity's Rigidbody.detectCollisions Documentation

    freezeRotation

    boolean
    ClientOnly

    The 'freezeRotation' property, when enabled, causes the Rigidbody to stop rotating under the influence of external forces or impacts - its rotation only changes if directly manipulated. This property can be useful when you want to control Rigidbody rotation directly, or when simulating items that resist rotation such as wheels or gyros. Unity's Rigidbody.freezeRotation Documentation

    The 'inertiaTensor' property determines the Rigidbody's inertia tensor, a measure of an object's resistance to changes in its rotational motion. Defining a custom inertia tensor can help simulate more complex rotational behavior. Unity's Rigidbody.inertiaTensor Documentation

    The 'inertiaTensorRotation' property specifies the rotation of the local space in which the inertia tensor is defined. This allows you to adjust the "shape" of the Rigidbody's mass. This property, in combination with inertiaTensor, can be used to fine-tune the rotational behavior of the Rigidbody. Unity's Rigidbody.inertiaTensorRotation Documentation

    isKinematic

    boolean
    ClientOnly

    The 'isKinematic' property, when enabled, makes the Rigidbody stop responding to forces, effectively turning off its built-in physics engine. The Rigidbody continues to interact with other non-kinematic bodies and collide with them but will move only when directly controlled by its Transform. This is useful when moving objects under direct player or script control. Unity's Rigidbody.isKinematic Documentation

    mass

    number
    ClientOnly

    The 'mass' property allows you to alter the mass of the Rigidbody. The mass of an object is an important aspect in physics-based interactions and plays a crucial role when calculating how forces affect it. For example, giving an object a larger mass in the game would make it harder to push around. Unity's Rigidbody.mass Documentation

    maxAngularVelocity

    number
    ClientOnly

    The 'maxAngularVelocity' property sets the maximum angular velocity of the Rigidbody. It can prevent fast rotating objects from moving too quickly, which could lead to instability in the physics simulation. Unity's Rigidbody.maxAngularVelocity Documentation

    maxDepenetrationVelocity

    number
    ClientOnly

    The 'maxDepenetrationVelocity' property sets the maximum velocity the Rigidbody can have when resolving penetration. It's useful primarily for sleeping bodies that are directly moved or affected by other bodies that initiate overlaps. Unity's Rigidbody.maxDepenetrationVelocity Documentation

    maxLinearVelocity

    number
    ClientOnly

    The 'maxLinearVelocity' property sets the maximum linear velocity of the Rigidbody. It is an effective way to cap the speed of fast-moving objects for stability or gameplay reasons. Unity's Rigidbody.maxLinearVelocity Documentation

    position

    ClientOnly

    The 'position' property gives you access to the position of the Rigidbody. It can be used to directly set the position of the Rigidbody in world space, and can be of significance while operating in kinematic mode or when you want to bypass physics simulation. Unity's Rigidbody.position Documentation

    The 'rotation' property provides you with access to the rotation of the Rigidbody. It can be used to directly set the rotation of the Rigidbody in world space. It can be crucial while operating in kinematic mode or when you want to bypass physics simulation to manually rotate the Rigidbody. Unity's Rigidbody.rotation Documentation

    sleepThreshold

    number
    ClientOnly

    The 'sleepThreshold' property defines the minimum energy a Rigidbody must have before it can be put to sleep. When a Rigidbody is asleep, it won't register any physics updates until it's woken up, saving processing power. Unity's Rigidbody.sleepThreshold Documentation

    solverIterations

    number
    ClientOnly

    The 'solverIterations' property allows you to adjust the number of solver iterations Unity performs for the Rigidbody. More iterations typically lead to more stable physics, but at the cost of extra computational overhead. Unity's Rigidbody.solverIterations Documentation

    solverVelocityIterations

    number
    ClientOnly

    The 'solverVelocityIterations' property sets the number of solver iterations used to solve velocity constraints. More iterations can improve stability but have performance implications. Unity's Rigidbody.solverVelocityIterations Documentation

    useGravity

    boolean
    ClientOnly

    The 'useGravity' property enables or disables the application of gravity on the Rigidbody. Disabling gravity might be useful for certain objects, like in a zero-gravity setting or while programming specific behaviors for an object, like a hover effect. Unity's Rigidbody.useGravity Documentation

    worldCenterOfMass

    ClientOnly
    ReadOnly

    The 'worldCenterOfMass' property accesses the global space position of the center of mass of the Rigidbody. This property is particularly handy when relying on the center of mass to calculate forces or torques that should affect the Rigidbody. Unity's Rigidbody.worldCenterOfMass Documentation

    Methods

    The 'AddExplosionForce' method applies a force to the Rigidbody that simulates the effect of an explosion at a given location. The force diminishes with increasing distance from the explosion source. This method can be used to create dynamic force effects in gameplay, like grenade explosions. Unity's Rigidbody.AddExplosionForce Documentation

    Parameters

    explosionForce
    number

    The magnitude of the force of the explosion.

    explosionPosition

    The position of the explosion origin.

    explosionRadius
    number

    The maximum distance from the explosion origin at which the explosion force is considered.

    upwardsModifier
    number

    Returns

    void

    The 'AddExplosionForce' method applies a force to the Rigidbody that simulates the effect of an explosion at a given location. The force diminishes with increasing distance from the explosion source. This method can be used to create dynamic force effects in gameplay, like grenade explosions. Unity's Rigidbody.AddExplosionForce Documentation

    Parameters

    explosionForce
    number

    The magnitude of the force of the explosion.

    explosionPosition

    The position of the explosion origin.

    explosionRadius
    number

    The maximum distance from the explosion origin at which the explosion force is considered.

    upwardsModifier
    number
    optional
    mode
    optional

    Returns

    void

    AddForce

    ClientOnly

    The 'AddForce' method applies a force to the Rigidbody in world coordinates. You can use this method to give an initial speed to a Rigidbody, or to simulate actions like a gust of wind or torrent pushing an object. You manipulate the speed and direction of Rigidbody through this method. Unity's Rigidbody.AddForce Documentation

    Parameters

    force

    The vector to apply as a force in the global space.

    mode
    optional

    Returns

    void

    AddForce

    ClientOnly

    The 'AddForce' method applies a force to the Rigidbody in world coordinates. You can use this method to give an initial speed to a Rigidbody, or to simulate actions like a gust of wind or torrent pushing an object. You manipulate the speed and direction of Rigidbody through this method. Unity's Rigidbody.AddForce Documentation

    Parameters

    x
    number
    y
    number
    z
    number

    Returns

    void

    AddForce

    ClientOnly

    The 'AddForce' method applies a force to the Rigidbody in world coordinates. You can use this method to give an initial speed to a Rigidbody, or to simulate actions like a gust of wind or torrent pushing an object. You manipulate the speed and direction of Rigidbody through this method. Unity's Rigidbody.AddForce Documentation

    Parameters

    x
    number
    y
    number
    z
    number

    Returns

    void

    The 'AddForceAtPosition' method applies a force to the Rigidbody at a specific position. Instead of applying the force through the center of mass, the force is applied at the specified position, creating a torque and causing the Rigidbody to rotate. This method is useful for creating precise scripted physics effects. Unity's Rigidbody.AddForceAtPosition Documentation

    Parameters

    force

    The vector to apply as a force.

    position

    The position in world coordinates where the force is applied.

    Returns

    void

    The 'AddForceAtPosition' method applies a force to the Rigidbody at a specific position. Instead of applying the force through the center of mass, the force is applied at the specified position, creating a torque and causing the Rigidbody to rotate. This method is useful for creating precise scripted physics effects. Unity's Rigidbody.AddForceAtPosition Documentation

    Parameters

    force

    The vector to apply as a force.

    position

    The position in world coordinates where the force is applied.

    mode
    optional

    Returns

    void

    The 'AddRelativeForce' method applies a force to the Rigidbody relative to its coordinate system, as opposed to world coordinates. This is useful in situations where you want an object to push forward on its local axis, or similar operation relative to the object rather than the world. Unity's Rigidbody.AddRelativeForce Documentation

    Parameters

    force

    The vector to apply as a force in the local space of the Rigidbody.

    mode
    optional

    Returns

    void

    The 'AddRelativeForce' method applies a force to the Rigidbody relative to its coordinate system, as opposed to world coordinates. This is useful in situations where you want an object to push forward on its local axis, or similar operation relative to the object rather than the world. Unity's Rigidbody.AddRelativeForce Documentation

    Parameters

    x
    number
    y
    number
    z
    number

    Returns

    void

    The 'AddRelativeForce' method applies a force to the Rigidbody relative to its coordinate system, as opposed to world coordinates. This is useful in situations where you want an object to push forward on its local axis, or similar operation relative to the object rather than the world. Unity's Rigidbody.AddRelativeForce Documentation

    Parameters

    x
    number
    y
    number
    z
    number

    Returns

    void

    Parameters

    x
    number
    y
    number
    z
    number

    Returns

    void

    Parameters

    x
    number
    y
    number
    z
    number

    Returns

    void

    Parameters

    torque
    mode
    optional

    Returns

    void

    Parameters

    x
    number
    y
    number
    z
    number

    Returns

    void

    Parameters

    x
    number
    y
    number
    z
    number

    Returns

    void

    The 'ClosestPointOnBounds' method finds the closest point to the provided position on the collider's boundary of the attached Rigidbody. This method can be advantageous in numerous scenarios such as checking how close an object is to touching or hitting something. Unity's Rigidbody.ClosestPointOnBounds Documentation

    Parameters

    position

    The world space point to find the closest point on the object to.

    Returns

    Returns the point on the bounding box of the collider attached to the Rigidbody that is closest to the specified location.

    The 'GetAccumulatedForce' method obtains the force accumulated on the Rigidbody over one physics simulation step. This is useful in certain effects or physics-based calculators that need to understand the amount of force being put on an object. Unity's Rigidbody.GetAccumulatedForce Documentation

    Parameters

    step
    number

    The step index to retrieve accumulated forces for.

    Returns

    Returns the accumulated force for the given step.

    The 'GetAccumulatedForce' method obtains the force accumulated on the Rigidbody over one physics simulation step. This is useful in certain effects or physics-based calculators that need to understand the amount of force being put on an object. Unity's Rigidbody.GetAccumulatedForce Documentation

    Parameters

    step
    number
    optional

    The step index to retrieve accumulated forces for.

    Returns

    Returns the accumulated force for the given step.

    The 'GetAccumulatedTorque' method retrieves the torque accumulated on the Rigidbody over one physics simulation step. Just like 'GetAccumulatedForce', this method is useful where you need to calculate the rotation effects based on the amount of torque applied on an object. Unity's Rigidbody.GetAccumulatedTorque Documentation

    Parameters

    step
    number

    The step index to retrieve accumulated torques for.

    Returns

    Returns the accumulated torque for the given step.

    The 'GetAccumulatedTorque' method retrieves the torque accumulated on the Rigidbody over one physics simulation step. Just like 'GetAccumulatedForce', this method is useful where you need to calculate the rotation effects based on the amount of torque applied on an object. Unity's Rigidbody.GetAccumulatedTorque Documentation

    Parameters

    step
    number
    optional

    The step index to retrieve accumulated torques for.

    Returns

    Returns the accumulated torque for the given step.

    The 'GetPointVelocity' method provides the velocity at which a point on the object is moving, including rotational velocity. This method is commonly used for visual effects or physics computations. For example, you might want to release a particle system at the position where a rotating wheel makes contact with the ground, and you want the particles to inherit the wheel's velocity at the contact point. Unity's Rigidbody.GetPointVelocity Documentation

    Parameters

    worldPoint

    The point in world space to calculate the velocity for.

    Returns

    Returns the velocity of the specified point.

    The 'GetRelativePointVelocity' function retrieves the velocity at which a point on the Rigidbody moves, relative to the Rigidbody, including any rotational velocity. This can be handy for numerous physical simulations or visual effects, such as calculating the directions of sparks when a rotating wheel hits an obstacle. Unity's Rigidbody.GetRelativePointVelocity Documentation

    Parameters

    relativePoint

    The point on the Rigidbody in local space for which to retrieve the relative velocity.

    Returns

    Returns the relative velocity of the specified point.

    IsSleeping

    ClientOnly

    The 'IsSleeping' method checks whether the Rigidbody is sleeping or not. It can be used to confirm that a Rigidbody is asleep, for instance, before applying a force to it, since such changes would wake up the Rigidbody. Unity's Rigidbody.IsSleeping Documentation

    Returns

    boolean

    Returns true if the Rigidbody is asleep, false otherwise.

    Move

    ClientOnly

    The 'Move' method simultaneously changes the position and rotation of the Rigidbody to match the specified position and rotation. This method affects the Rigidbody's position and rotation using physics and is therefore useful for moving objects under the control of physics. Unity's Rigidbody.Move Documentation

    Parameters

    position

    The new position for the Rigidbody in world space.

    rotation

    The new rotation for the Rigidbody.

    Returns

    void

    MovePosition

    ClientOnly

    The 'MovePosition' method moves the Rigidbody to the specified position by calculating the appropriate linear velocity required to move the Rigidbody to that position during the next physics update. This method is particularly useful when you want to instantly move a Rigidbody in response to player input or AI calculations. Unity's Rigidbody.MovePosition Documentation

    Parameters

    position

    The target position for the Rigidbody in world space.

    Returns

    void

    MoveRotation

    ClientOnly

    The 'MoveRotation' method rotates the Rigidbody to the specified rotation by calculating the appropriate angular velocity required to rotate the Rigidbody to that rotation during the next physics update. It is commonly used for rotating Rigidbodies that are under the influence of physics. Unity's Rigidbody.MoveRotation Documentation

    Parameters

    The new rotation for the Rigidbody.

    Returns

    void

    The 'ResetCenterOfMass' method resets the center of mass of the Rigidbody by calculating it based on the attached colliders. This can be useful if the Rigidbody's mass or shape has changed, and you need to recalibrate the center of mass. Unity's Rigidbody.ResetCenterOfMass Documentation

    Returns

    void

    The 'ResetInertiaTensor' method resets the inertia tensor of the Rigidbody by calculating it based on the shape of the attached colliders. This is similar to ResetCenterOfMass and is useful when the Rigidbody's mass or shape has changed. The inertia tensor influences how the Rigidbody's shape behaves when it rotates. Unity's Rigidbody.ResetInertiaTensor Documentation

    Returns

    void

    SetDensity

    ClientOnly

    The 'SetDensity' method forces the mass of the Rigidbody to adjust to the given density. This method is useful for recalculating mass after changing the mass of the object, especially when dealing with variable density fluids or building a physics puzzle. Unity's Rigidbody.SetDensity Documentation

    Parameters

    density
    number

    The density to be set on the Rigidbody.

    Returns

    void

    Sleep

    ClientOnly

    The 'Sleep' method is used to put the Rigidbody to sleep. When a Rigidbody is asleep, it won't register any physics updates until it's woken up, saving processing power. In most cases, you won't need to manually put a Rigidbody to sleep, as Unity does it automatically when objects come to rest. However, there may be times when you need to put a Rigidbody to sleep instantly, for example, when a game object should freeze in place. Unity's Rigidbody.Sleep Documentation

    Returns

    void

    SweepTest

    ClientOnly

    The 'SweepTest' method checks if a Rigidbody would collide with anything, if it was moved through the Scene. This can be used to predict collisions before moving an object or to find out if an area is clear from obstacles. The method provides information about what the Rigidbody would hit if it was moved through its environment. Unity's Rigidbody.SweepTest Documentation

    Parameters

    direction

    The direction in which to sweep the Rigidbody.

    Returns

    boolean

    Returns true if a Rigidbody collider is hit, and includes information about the object hit in a RaycastHit object.

    SweepTest

    ClientOnly

    The 'SweepTest' method checks if a Rigidbody would collide with anything, if it was moved through the Scene. This can be used to predict collisions before moving an object or to find out if an area is clear from obstacles. The method provides information about what the Rigidbody would hit if it was moved through its environment. Unity's Rigidbody.SweepTest Documentation

    Parameters

    direction

    The direction in which to sweep the Rigidbody.

    maxDistance
    number

    The maximum distance over which to sweep the Rigidbody.

    Returns

    boolean

    Returns true if a Rigidbody collider is hit, and includes information about the object hit in a RaycastHit object.

    Parameters

    direction
    maxDistance
    number

    Parameters

    direction
    maxDistance
    number
    optional

    WakeUp

    ClientOnly

    The 'WakeUp' method is used to wake up a sleeping Rigidbody. Once woken, it will start receiving physics updates again. This is often useful when you want to instantly wake up a Rigidbody to reapply physics to it. Unity's Rigidbody.WakeUp Documentation

    Returns

    void

    Updated 9 days ago

    PocketWorlds Icon

    © 2025 Pocket Worlds. All rights reserved.