Arma 3 Scripting

selectionPosition

  • Global argument
  • Arma 3 v0.50
  • First in Armed Assault v1.00

Command · also in Render Time Scope · Markdown · JSON · original wiki page

Description

Returns selection position in model space pertaining to the current animation in render time scope. When the default syntax is used, command searches first in Memory LOD, then in Geometry LOD, FireGeometry LOD, LandContact LOD, HitPoints LOD and finally in ViewGeometry LOD and returns the first matching find. The second syntax allows to specify which one of these LODs to search in instead.

Important

Sometimes internally "ViewGeometry" could be equal to "Geometry", and "FireGeometry" could be equal to "ViewGeometry".

In order to pinpoint the actual LOD, use allLODs and LOD resolution as argument for selecting the LOD.

Also note that similar models can have different LOD indexes, for example a soldier model differs from a model of civilian in this regard.

Syntax

Syntax 1

object selectionPosition selectionName

Parameters:

Returns: PositionRelative - If selection does not exist, [0, 0, 0] is returned.

Syntax 2

since arma3 1.50

object selectionPosition [selectionName, LOD, returnMode]

Parameters:

Returns: PositionRelative - If selection does not exist, [0, 0, 0] is returned. If returnMode is "BoundingBox", Array of Arrays

Syntax 3

since arma3 2.06

selectionPosition [object, selectionName, LODIndex, isVisual, returnMode]

Parameters:

Returns: PositionRelative - If selection does not exist, [0, 0, 0] is returned. If returnMode is "BoundingBox", Array of Arrays

Examples

Example 1

_inModelPosition = player selectionPosition "head_hit";

Example 2

_inModelPosition = player selectionPosition "pelvis";

Example 3

_inModelPosition = player selectionPosition "head";

Example 4

_inModelPosition = player selectionPosition "camera";

Example 5

stomper selectionPosition ["wheel_1_1", "HitPoints", "FirstPoint"];    // [-0.774058,0.860854,-1.40365]
stomper selectionPosition ["wheel_1_1", "HitPoints", "AveragePoint"];    // [-0.597142,1.35486,-1.58345]
stomper selectionPosition ["wheel_1_1", "HitPoints", "BoundingBox"];    // [[-0.774058,0.860854,-2.07746],[-0.420225,1.84887,-1.08944]]

See also

selectionVectorDirAndUp · modelToWorld · selectionNames · getAllHitPointsDamage · allLODs · LOD resolutions

Community notes