{"name":"selectionPosition","operator":null,"title":"selectionPosition","type":"command","url":"https://community.bistudio.com/wiki/selectionPosition","revid":377819,"updated":"2026-01-03T04:18:08Z","groups":["Object Manipulation","Render Time Scope"],"status":"ok","replaced_by":[],"games":[{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma1","name":"Armed Assault","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"global","effect":null,"server_exec":false},"exec":null,"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> 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","since":null,"effect":null,"exec":null,"params":[{"name":"object","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"object: Object"},{"name":"selectionName","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"selectionName: String"}],"returns":{"type":"relative position","types":["relative position"],"description":"If selection does not exist, [0, 0, 0] is returned.","text":"relative position - If selection does not exist, [0, 0, 0] is returned."},"form":"binary","operator":null,"left":{"text":"object","types":["Object"]},"right":{"text":"selectionName","types":["String"]}},{"syntax":"object selectionPosition [selectionName, LOD, returnMode]","since":"arma3 1.50","effect":null,"exec":null,"params":[{"name":"object","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"object: Object"},{"name":"selectionName","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"selectionName: String"},{"name":"LOD","type":"String or Number","optional":false,"default":null,"description":"can be one of:\n- `\"Memory\"`\n- `\"Geometry\"`\n- `\"FireGeometry\"`\n- `\"LandContact\"`\n- `\"HitPoints\"`\n- Arma 3 v2.06 `\"ViewGeometry\"`\nWhen Number is used, command searches for a LOD with the similar LOD resolution","types":["String","Number"],"since":"arma3 2.06","text":"LOD: String or Number - can be one of:\n- `\"Memory\"`\n- `\"Geometry\"`\n- `\"FireGeometry\"`\n- `\"LandContact\"`\n- `\"HitPoints\"`\n- Arma 3 v2.06 `\"ViewGeometry\"`\nWhen Number is used, command searches for a LOD with the similar LOD resolution"},{"name":"returnMode","type":"String","optional":true,"default":"`\"FirstPoint\"`","description":"can be one of:\n- `\"FirstPoint\"`\n- `\"AveragePoint\"`\n- `\"BoundingBox\"`","types":["String"],"since":"arma3 2.08","text":"returnMode: String - (Optional, default `\"FirstPoint\"`) can be one of:\n- `\"FirstPoint\"`\n- `\"AveragePoint\"`\n- `\"BoundingBox\"`"}],"returns":{"type":"relative position","types":["relative position"],"description":"If selection does not exist, [0, 0, 0] is returned. If returnMode is `\"BoundingBox\"`, Array of Arrays","text":"relative position - If selection does not exist, [0, 0, 0] is returned. If returnMode is `\"BoundingBox\"`, Array of Arrays"},"form":"binary","operator":null,"left":{"text":"object","types":["Object"]},"right":{"text":"[selectionName, LOD, returnMode]","types":["Array"]}},{"syntax":"selectionPosition [object, selectionName, LODIndex, isVisual, returnMode]","since":"arma3 2.06","effect":null,"exec":null,"params":[{"name":"object","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"object: Object"},{"name":"selectionName","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"selectionName: String"},{"name":"LODIndex","type":"Number","optional":false,"default":null,"description":"the index of the target LOD (see allLODs)","types":["Number"],"since":null,"text":"LODIndex: Number - the index of the target LOD (see allLODs)"},{"name":"isVisual","type":"Boolean","optional":true,"default":"true","description":"true for Render, false for Simulation time scope","types":["Boolean"],"since":null,"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- `\"FirstPoint\"`\n- `\"AveragePoint\"`\n- `\"BoundingBox\"`","types":["String"],"since":"arma3 2.08","text":"returnMode: String - (Optional, default `\"FirstPoint\"`) can be one of:\n- `\"FirstPoint\"`\n- `\"AveragePoint\"`\n- `\"BoundingBox\"`"}],"returns":{"type":"relative position","types":["relative position"],"description":"If selection does not exist, [0, 0, 0] is returned. If returnMode is `\"BoundingBox\"`, Array of Arrays","text":"relative position - If selection does not exist, [0, 0, 0] is returned. If returnMode is `\"BoundingBox\"`, Array of Arrays"},"form":"unary","operator":null,"left":null,"right":{"text":"[object, selectionName, LODIndex, isVisual, returnMode]","types":["Array"]}}],"examples":[{"text":"```sqf\n_inModelPosition = player selectionPosition \"head_hit\";\n```","code":["_inModelPosition = player selectionPosition \"head_hit\";"]},{"text":"```sqf\n_inModelPosition = player selectionPosition \"pelvis\";\n```","code":["_inModelPosition = player selectionPosition \"pelvis\";"]},{"text":"```sqf\n_inModelPosition = player selectionPosition \"head\";\n```","code":["_inModelPosition = player selectionPosition \"head\";"]},{"text":"```sqf\n_inModelPosition = player selectionPosition \"camera\";\n```","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]]"]}],"multiplayer":null,"problems":null,"aliases":[],"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```"}],"categories":["ArmA: Armed Assault: New Scripting Commands","ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Manipulation","Command Group: Render Time Scope","Introduced with Armed Assault version 1.00","Scripting Commands","Take On Helicopters: Scripting Commands"]}