{"name":"setDestination","operator":null,"title":"setDestination","type":"command","url":"https://community.bistudio.com/wiki/setDestination","revid":377507,"updated":"2026-01-02T06:50:09Z","groups":["Unit Control"],"status":"ok","replaced_by":[],"games":[{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"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":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"local","effect":"global","server_exec":false},"exec":null,"description":"Set the destination for path planning of the pilot.\n\nPossible values for planningMode are:\n\n- \"DoNotPlan\" - used when not moving\n- \"DoNotPlanFormation\" - used in formation when simple path testing is used\n- \"LEADER PLANNED\" - used for formation leader (full path finding used)\n- \"LEADER DIRECT\" - used for DirectGo (like getin, supply)\n- \"FORMATION PLANNED\" - used in formation when full path finding is used\n- \"VEHICLE PLANNED\" - used for vehicle driver\n\nWorks best when used on agents. Using \"LEADER PLANNED\" will trigger `\"PathCalculated\"` Event Handler","syntaxes":[{"syntax":"object setDestination [position, planningMode, forceReplan]","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":"position","type":"Position","optional":false,"default":null,"description":null,"types":["Position"],"since":null,"text":"position: Position"},{"name":"planningMode","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"planningMode: String"},{"name":"forceReplan","type":"Boolean","optional":false,"default":null,"description":"specifies if replanning of the path should be forced.","types":["Boolean"],"since":null,"text":"forceReplan: Boolean - specifies if replanning of the path should be forced."}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"object","types":["Object"]},"right":{"text":"[position, planningMode, forceReplan]","types":["Array"]}}],"examples":[{"text":"```sqf\nbob setDestination [screenToWorld [0.5,0.5], \"LEADER PLANNED\", true];\n```","code":["bob setDestination [screenToWorld [0.5,0.5], \"LEADER PLANNED\", true];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["expectedDestination","doMove","calculatePath"],"notes":[],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Unit Control","Introduced with Operation Flashpoint: Elite version 1.00","Operation Flashpoint: Elite: New Scripting Commands","Operation Flashpoint: Elite: Scripting Commands","Scripting Commands","Scripting Commands: Global Effect","Take On Helicopters: Scripting Commands"]}