{"name":"selectionPosition","title":"selectionPosition","type":"command","url":"https://community.bistudio.com/wiki/selectionPosition","revid":379300,"updated":"2026-10-30T23:48:10Z","groups":["Object Manipulation","Render Time Scope"],"status":"ok","games":{"arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma1 1.00","arma3_since":"0.50","locality":{"argument":"global"},"description":"Returns selection position in model space pertaining to the current animation in render time scope.\nWhen 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.\nThe second syntax allows to specify which one of these LODs to search in instead.\n\n> [!IMPORTANT]\n> Sometimes internally \"ViewGeometry\" could be equal to \"Geometry\", and \"FireGeometry\" could be equal to \"ViewGeometry\".\n>\n> In order to pinpoint the actual LOD, use allLODs and LOD resolution as argument for selecting the LOD.\n>\n> Also note that similar models can have different LOD indexes, for example a soldier model differs from a model of civilian in this regard.","syntaxes":[{"syntax":"object selectionPosition selectionName","params":[{"name":"object","type":"Object","type_expr":"Object"},{"name":"selectionName","type":"String","type_expr":"String"}],"returns":{"type":"PositionRelative","type_expr":"PositionRelative","description":"If selection does not exist, [0, 0, 0] is returned."},"form":"binary","left":{"text":"object"},"right":{"text":"selectionName"}},{"syntax":"object selectionPosition [selectionName, LOD, returnMode]","since":"arma3 1.50","params":[{"name":"object","type":"Object","type_expr":"Object"},{"name":"selectionName","type":"String","type_expr":"String"},{"name":"LOD","type":"String or Number","description":"can be one of:\n\n- `\"Memory\"`\n- `\"Geometry\"`\n- `\"FireGeometry\"`\n- `\"LandContact\"`\n- `\"HitPoints\"`\n- Arma 3 v2.06 `\"ViewGeometry\"`\n\nWhen Number is used, command searches for a LOD with the similar LOD resolution","type_expr":"String | Number","since":"arma3 2.06"},{"name":"returnMode","type":"String","optional":true,"default":"`\"FirstPoint\"`","description":"can be one of:\n\n- `\"FirstPoint\"`\n- `\"AveragePoint\"`\n- `\"BoundingBox\"`","type_expr":"String","since":"arma3 2.08","text":"returnMode: String - (Optional, default `\"FirstPoint\"`) can be one of:\n\n- `\"FirstPoint\"`\n- `\"AveragePoint\"`\n- `\"BoundingBox\"`"}],"returns":{"type":"PositionRelative","type_expr":"PositionRelative","description":"If selection does not exist, [0, 0, 0] is returned. If returnMode is `\"BoundingBox\"`, Array of Arrays"},"form":"binary","left":{"text":"object"},"right":{"text":"[selectionName, LOD, returnMode]"}},{"syntax":"selectionPosition [object, selectionName, LODIndex, isVisual, returnMode]","since":"arma3 2.06","params":[{"name":"object","type":"Object","type_expr":"Object"},{"name":"selectionName","type":"String","type_expr":"String"},{"name":"LODIndex","type":"Number","description":"the index of the target LOD (see allLODs)","type_expr":"Number"},{"name":"isVisual","type":"Boolean","optional":true,"default":"true","description":"true for Render, false for Simulation time scope","type_expr":"Boolean","text":"isVisual: Boolean - (Optional, default true) true for Render, false for Simulation time scope"},{"name":"returnMode","type":"String","optional":true,"default":"`\"FirstPoint\"`","description":"can be one of:\n\n- `\"FirstPoint\"`\n- `\"AveragePoint\"`\n- `\"BoundingBox\"`","type_expr":"String","since":"arma3 2.08","text":"returnMode: String - (Optional, default `\"FirstPoint\"`) can be one of:\n\n- `\"FirstPoint\"`\n- `\"AveragePoint\"`\n- `\"BoundingBox\"`"}],"returns":{"type":"PositionRelative","type_expr":"PositionRelative","description":"If selection does not exist, [0, 0, 0] is returned. If returnMode is `\"BoundingBox\"`, Array of Arrays"},"form":"unary","right":{"text":"[object, selectionName, LODIndex, isVisual, returnMode]"}}],"examples":[{"code":["_inModelPosition = player selectionPosition \"head_hit\";"]},{"code":["_inModelPosition = player selectionPosition \"pelvis\";"]},{"code":["_inModelPosition = player selectionPosition \"head\";"]},{"code":["_inModelPosition = player selectionPosition \"camera\";"]},{"text":"```sqf\nstomper selectionPosition [\"wheel_1_1\", \"HitPoints\", \"FirstPoint\"];    // [-0.774058,0.860854,-1.40365]\nstomper selectionPosition [\"wheel_1_1\", \"HitPoints\", \"AveragePoint\"];    // [-0.597142,1.35486,-1.58345]\nstomper selectionPosition [\"wheel_1_1\", \"HitPoints\", \"BoundingBox\"];    // [[-0.774058,0.860854,-2.07746],[-0.420225,1.84887,-1.08944]]\n```","code":["stomper selectionPosition [\"wheel_1_1\", \"HitPoints\", \"FirstPoint\"];\t// [-0.774058,0.860854,-1.40365]\nstomper selectionPosition [\"wheel_1_1\", \"HitPoints\", \"AveragePoint\"];\t// [-0.597142,1.35486,-1.58345]\nstomper selectionPosition [\"wheel_1_1\", \"HitPoints\", \"BoundingBox\"];\t// [[-0.774058,0.860854,-2.07746],[-0.420225,1.84887,-1.08944]]"]}],"see_also":["selectionVectorDirAndUp","modelToWorld","selectionNames","getAllHitPointsDamage","allLODs","LOD resolutions"],"notes":[{"user":"Killzone_Kid","date":"2017-06-25T15:13:00Z","text":"Do use the filter that comes with Syntax 2 to suit your needs. For example player has 3 selections called \"head\" and their selectionPositions are quite different from each other:\n\n```sqf\nplayer selectionPosition [\"head\", \"Memory\"];        // [0.173798,0.330415,1.37783]\nplayer selectionPosition [\"head\", \"FireGeometry\"];    // [0.14375,0.206039,1.44689]\nplayer selectionPosition [\"head\", \"HitPoints\"];    // [0.144257,0.306769,1.53471]\n```"}]}