Skip to content

@modoki/engine / index / addForce2D

Function: addForce2D()

addForce2D(world, entity, x, y, wakeUp?): boolean

Add a CONTINUOUS linear force (world units). NOTE Rapier semantics: the force persists across steps until resetForces2D — re-add per frame (and reset), or prefer applyImpulse2D for one-shots.

Parameters

world

World

entity

Entity

x

number

y

number

wakeUp?

boolean = true

Returns

boolean

Built with Modoki.