addForce: Difference between revisions
Jump to navigation
Jump to search
m (formatting) |
Lou Montana (talk | contribs) m (Text replacement - "\|game([0-9]) ?= (.+) \|version([0-9]) ?= (.+) " to "|game$1= $2 |version$3= $4 ") |
||
Line 2: | Line 2: | ||
|game1= arma3 | |game1= arma3 | ||
|version1= 1.72 | |version1= 1.72 | ||
Revision as of 14:54, 3 May 2021
Description
- Description:
- Applies force to given object at given position. Force is defined as vector [x, y, z] in world space, position is vector [x, y, z] in model space. If you need to define force in model space, use vectorModelToWorld or vectorModelToWorldVisual commands first. The force applied as impulse. For more information see NVIDIA docs
- Groups:
- Object Manipulation
Syntax
- Syntax:
- object addForce [force, position]
- Parameters:
- object: Object - PhysX object
- force: Array - Force vector (in world space) in format [x,y,z]
- position: Array - Model PositionRelative to which force is applied in format [x,y,z]
- 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]:
_object addForce [_object vectorModelToWorld [0,1000,0],[1,0,0]];
- Example 3:
- Since Arma 3 v2.03.147267, can be used on units:
[] spawn { bob addForce [bob vectorModelToWorld [0,-200,0], bob selectionPosition "rightfoot"]; sleep 5; bob setUnconscious false; };
Additional Information
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