setUnitPos: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Take[ _]On[ _]Helicopters(\|.*)?\]\]" to "{{GameCategory|tkoh|Scripting Commands}}")
m (Text replacement - "_{10,} " to "")
Line 1: Line 1:
{{Command|Comments=
{{Command|Comments=
____________________________________________________________________________________________


| ofp |Game name=
| ofp |Game name=
Line 10: Line 9:


|gr1= Unit Control |GROUP1=
|gr1= Unit Control |GROUP1=
____________________________________________________________________________________________


| Set unit position rules. Mode may be one of:  
| Set unit position rules. Mode may be one of:  
Line 23: Line 21:


|DESCRIPTION=
|DESCRIPTION=
____________________________________________________________________________________________


| unit '''setUnitPos''' mode |SYNTAX=
| unit '''setUnitPos''' mode |SYNTAX=
Line 32: Line 29:


| [[Nothing]] |RETURNVALUE=
| [[Nothing]] |RETURNVALUE=
____________________________________________________________________________________________
   
   
|x1= <code>_soldier [[setUnitPos]] "UP";</code> |EXAMPLE1=
|x1= <code>_soldier [[setUnitPos]] "UP";</code> |EXAMPLE1=
____________________________________________________________________________________________


| [[setUnitPosWeak]], [[unitPos]]|SEEALSO=
| [[setUnitPosWeak]], [[unitPos]]|SEEALSO=

Revision as of 04:59, 17 January 2021

Hover & click on the images for description

Description

Description:
Set unit position rules. Mode may be one of:
  • "DOWN" - unit goes prone and stays prone.
  • "UP" - unit stands and stays standing.
  • "MIDDLE" - Kneel Position. ArmA version 1.04 (Unit will not kneel if it is unarmed)
  • "AUTO" - unit chooses mode according to circumstances.
This command will not change the stance of the human player, even though it will change the output of unitPos command. To change player stance use playAction or playActionNow: player playAction "PlayerProne"; // DOWN player playAction "PlayerStand"; // UP player playAction "PlayerCrouch"; // MIDDLE
Groups:
Unit Control

Syntax

Syntax:
unit setUnitPos mode
Parameters:
unit: Object
mode: String - as above
Return Value:
Nothing

Examples

Example 1:
_soldier setUnitPos "UP";

Additional Information

See also:
setUnitPosWeakunitPos

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

Notes

Posted on 18 September 2008‎
Dwarden
Command most likely only works if run before join into group after createUnit.
Posted on 11 March 2011
kju
The above comment by Dwarden about 'an additional join required' is no longer true for Operation Arrowhead.
Posted on 26 September 2013‎
Katulobotomia
A unit might not always go prone when ordered to setUnitPos "DOWN", if the unit doesn't agree with the command. To force the unit to go prone, stop the unit from firing by setCombatMode "BLUE" and then order the unit to prone.

Bottom Section