{"name":"lightAttachObject","operator":null,"title":"lightAttachObject","type":"command","url":"https://community.bistudio.com/wiki/lightAttachObject","revid":377510,"updated":"2026-01-02T06:50:14Z","groups":["Lights"],"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":"global","effect":"local","server_exec":false},"exec":null,"description":"Attach light to given object at given position on object.","syntaxes":[{"syntax":"light lightAttachObject [object, position]","since":null,"effect":null,"exec":null,"params":[{"name":"light","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"light: Object"},{"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"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"light","types":["Object"]},"right":{"text":"[object, position]","types":["Array"]}}],"examples":[{"text":"```sqf\nmyLight lightAttachObject [myVehicle, [-0.5,-0.25,1]];\n```","code":["myLight lightAttachObject [myVehicle, [-0.5,-0.25,1]];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["setLightAmbient","setLightBrightness","lightDetachObject","setLightColor","setLightIntensity","setLightAttenuation","setLightUseFlare","setLightFlareSize","setLightFlareMaxDistance","setLightDayLight","attachObject","attachTo","attachedObjects","attachedTo","waypointAttachVehicle","waypointAttachedVehicle","triggerAttachVehicle","attachedObject"],"notes":[{"user":"Feersum","date":"2006-12-01T16:42:00Z","text":"Light can be created with command createVehicleLocal with special vehicle class \"#lightpoint\"\n\nfor example:\n\n```sqf\n_light = \"#lightpoint\" createVehicleLocal pos;\n_light setLightBrightness 1.0;\n_light setLightAmbient [0.0, 1.0, 0.0];\n_light setLightColor [0.0, 1.0, 0.0];\n_light lightAttachObject [_object, [0,0,0]];\n```"},{"user":"Waffle SS.","date":"2015-03-31T04:49:00Z","text":"When attached, movement is slow to update (jumpy).  Use attachTo when attaching a light to moving objects."}],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Lights","Introduced with Operation Flashpoint: Elite version 1.00","Operation Flashpoint: Elite: New Scripting Commands","Operation Flashpoint: Elite: Scripting Commands","Scripting Commands","Scripting Commands: Local Effect","Take On Helicopters: Scripting Commands"]}