Collider:applyLinearImpulse

Edit

Applies a linear impulse to the Collider.

An impulse is a single instantaneous push. Impulses are independent of time, and are meant to only be applied once. Use Collider:applyForce for a time-dependent push that happens over multiple frames.





Apply an impulse at the center of mass.

Arguments

NameTypeDescription
xnumber The x component of the world-space impulse vector, in newton seconds.
ynumber The y component of the world-space impulse vector, in newton seconds.
znumber The z component of the world-space impulse vector, in newton seconds.

Returns

Nothing

Apply an impulse at a custom position.

Arguments

NameTypeDescription
xnumber The x component of the world-space impulse vector, in newton seconds.
ynumber The y component of the world-space impulse vector, in newton seconds.
znumber The z component of the world-space impulse vector, in newton seconds.
pxnumber The x position to apply the impulse at, in world space.
pynumber The y position to apply the impulse at, in world space.
pznumber The z position to apply the impulse at, in world space.

Returns

Nothing

Apply an impulse at the center of mass, using vector types.

Arguments

NameTypeDescription
impulseVec3 The world-space impulse vector, in newton seconds.

Returns

Nothing

Apply an impulse at a custom position, using vector types.

Arguments

NameTypeDescription
impulseVec3 The world-space impulse vector, in newton seconds.
positionVec3 The position to apply the impulse at, in world space.

Returns

Nothing

Notes

Kinematic colliders ignore forces.

If the Collider is asleep, this will wake it up.

Impulses are accumulated and processed during World:update.

See also