Skip to content

Component Rigidbody

Berke edited this page Jun 23, 2026 · 1 revision

Rigidbody

The Rigidbody component provides physics-based movement, forces, and simulation control for entities.


Properties

isValid

rb.isValid

Returns whether the rigidbody is valid.

Returns

boolean

isStatic

rb.isStatic

Defines whether the rigidbody is static (immovable).

Returns

boolean

Example

rb.isStatic = true

mass

rb.mass

Mass of the rigidbody.

Returns

number

Example

rb.mass = 10.0

gravityScale

rb.gravityScale

Multiplier for gravity affecting this body.

Returns

number

friction

rb.friction

Surface friction coefficient.

Returns

number

velocity

rb.velocity

Current linear velocity.

Returns

Vector3

Example

rb.velocity = Vector3(0, 10, 0)

Methods

addVelocity

rb:addVelocity(velocity)

Adds velocity to the current rigidbody motion.

Parameters

Name Type Description
velocity Vector3 Velocity to add

Returns

nil

Example

rb:addVelocity(Vector3(1, 0, 0))

Example Usage

local rb = entity.rigidbody

rb.mass = 5
rb.gravityScale = 1

rb.velocity = Vector3(0, 5, 0)
rb:addVelocity(Vector3(1, 0, 0))

Clone this wiki locally