ApplyEntityForce
From OxeyeWiki
physics:applyEntityForce(entityId, positionX, positionY, forceX, forceY) | ||
Applies a force at a given world position on a given entity. | ||
Parameter | Expected Type | Description |
enitityId | An integer | The entity's body identifier. |
positionX | A number | World X position where the force should be applied, measured in meters. |
positionY | A number | World Y position where the force should be applied, measured in meters. |
forceX | A number | Amount of horizontal force to be applied, measured in Newton. |
forceY | A number | Amount of vertical force to be applied, measured in Newton. |
Returns | ||
Returns nothing. |
Example
physics:applyEntityForce(player.body, fan.x * physResolution, fan.y * physResolution, fan.force.x, fan.force.y)