addForce: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Some wiki formatting) |
Lou Montana (talk | contribs) m (Fix) |
||
Line 15: | Line 15: | ||
|s1= object [[addForce]] [force, position] | |s1= object [[addForce]] [force, position] | ||
|p1= object: [[Object]] - PhysX object or {{GVI|arma3|2.04|size= 0.75}}{{Icon|localargument|24}} unit, in which case the unit must be local and will be | |p1= object: [[Object]] - PhysX object or {{GVI|arma3|2.04|size= 0.75}}{{Icon|localargument|24}} unit, in which case the unit must be local and will be [[setUnconscious|set unconscious]] | ||
|p2= force: [[Array]] - in format [x,y,z], force vector in '''world''' space. Force is in [https://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/apireference/files/structPxForceMode.html Newton] | |p2= force: [[Array]] - in format [x,y,z], force vector in '''world''' space. Force is in [https://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/apireference/files/structPxForceMode.html Newton] |
Revision as of 20:04, 25 April 2023
Description
- Description:
- Applies impulse force to unit or given PhysX object at given position.
- Groups:
- Object Manipulation
Syntax
- Syntax:
- object addForce [force, position]
- Parameters:
- object: Object - PhysX object or 2.04LALocal unit, in which case the unit must be local and will be set unconscious
- force: Array - in format [x,y,z], force vector in world space. Force is in Newton
- position: Array - in format [x,y,z], in object's relative position
- Return Value:
- Nothing
Examples
- Example 1:
- Apply force [0,1000,0] defined in world space (not factoring object actual positioning) to object position [1,0,0]:
_object addForce [[0,1000,0], [1,0,0]];
- Example 2:
- Apply force [0,1000,0] defined in model space (relative to object) to object position [1,0,0]:
- Example 3:
- Can be used on units since Arma 3 v2.04:
if (local bob) then { [] spawn { bob addForce [bob vectorModelToWorld [0,-200,0], bob selectionPosition "rightfoot"]; sleep 5; bob setUnconscious false; }; };
Additional Information
- See also:
- addTorque awake isAwake vectorModelToWorld vectorModelToWorldVisual selectionPosition disableBrakes brakesDisabled
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note