Chipmunk2D Unity Documentation | Main Page | Forum

Manual

Tutorials

API

Classes

Structs

Enumerations

ChipmunkBody.ApplyForce()

function ApplyForce(force : Vector2, localPosition : Vector2) : void

Parameters


forceThe force to apply to the body.
localPositionThe position in the transform's local coordinates to apply the force at.

Description

Apply (accumulate) a force on the body at the given point in the transform's local coords.

This will add to the current ChipmunkBody.force and ChipmunkBody.torque values. Make sure to reset the values if you are reapplying the function every fixed time step.