lightAttachObject: Difference between revisions

From Bohemia Interactive Community
(added example of how to create light object used with this command)
mNo edit summary
 
(90 intermediate revisions by 12 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma |= Game name
|game1= ofpe
|version1= 1.00


|1.00|= Game version
|game2= arma1
____________________________________________________________________________________________
|version2= 1.00


| Attach light to given object (at given position). |= Description
|game3= arma2
____________________________________________________________________________________________
|version3= 1.00


| light '''lightAttachObject''' [object, position] |= Syntax
|game4= arma2oa
|version4= 1.50


|p1= light: [[Object]] |= Parameter 1
|game5= tkoh
|version5= 1.00


|p2= [object, position]: [[Array]] |= Parameter 2
|game6= arma3
|version6= 0.50


| [[Nothing]] |= Return value
|gr1= Lights
____________________________________________________________________________________________


| |= See also
|arg= global


}}
|eff= local


<h3 style="display:none">Notes</h3>
|descr= Attach light to given object at given position on object.
<dl class="command_description">
<!-- Note Section BEGIN -->
Light can be created with command createVehicle with special vehicle class "#lightpoint"


for example:
|s1= light [[lightAttachObject]] [object, position]


_light = "#lightpoint" createVehicleLocal pos;
|p1= light: [[Object]]


_light setLightBrightness 1.0;
|p2= object: [[Object]]


_light setLightAmbient[0.0, 1.0, 0.0];
|p3= position: [[Position]]


_light setLightColor[0.0, 1.0, 0.0];
|r1= [[Nothing]]


_light lightAttachObject [_object, [0,0,0]]
|x1= <sqf>myLight lightAttachObject [myVehicle, [-0.5,-0.25,1]];</sqf>


|seealso= [[setLightAmbient]] [[setLightBrightness]] [[lightDetachObject]] [[setLightColor]] [[setLightIntensity]] [[setLightAttenuation]] [[setLightUseFlare]] [[setLightFlareSize]] [[setLightFlareMaxDistance]] [[setLightDayLight]] [[attachObject]] [[attachTo]] [[attachedObjects]] [[attachedTo]] [[waypointAttachVehicle]] [[waypointAttachedVehicle]] [[triggerAttachVehicle]] [[attachedObject]]
}}


<!-- Note Section END -->
{{Note
</dl>
|user= Feersum
|timestamp= 20061201164200
|text= Light can be created with command [[createVehicleLocal]] with special vehicle class "#lightpoint"<br>
for example:
<sqf>
_light = "#lightpoint" createVehicleLocal pos;
_light setLightBrightness 1.0;
_light setLightAmbient [0.0, 1.0, 0.0];
_light setLightColor [0.0, 1.0, 0.0];
_light lightAttachObject [_object, [0,0,0]];
</sqf>
}}


<h3 style="display:none">Bottom Section</h3>
{{Note
[[Category:Scripting Commands|LIGHTATTACHOBJECT]]
|user= Waffle SS.
[[Category:Scripting Commands OFP Elite |LIGHTATTACHOBJECT]]
|timestamp= 20150331044900
[[Category:Scripting Commands ArmA|LIGHTATTACHOBJECT]]
|text= When attached, movement is slow to update (jumpy).  Use [[attachTo]] when attaching a light to moving objects.
}}

Latest revision as of 07:50, 2 January 2026

Hover & click on the images for description

Description

Description:
Attach light to given object at given position on object.
Groups:
Lights

Syntax

Syntax:
light lightAttachObject [object, position]
Parameters:
light: Object
object: Object
position: Position
Return Value:
Nothing

Examples

Example 1:
myLight lightAttachObject [myVehicle, [-0.5,-0.25,1]];

Additional Information

See also:
setLightAmbient setLightBrightness lightDetachObject setLightColor setLightIntensity setLightAttenuation setLightUseFlare setLightFlareSize setLightFlareMaxDistance setLightDayLight attachObject attachTo attachedObjects attachedTo waypointAttachVehicle waypointAttachedVehicle triggerAttachVehicle attachedObject

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note
Feersum - c
Posted on Dec 01, 2006 - 16:42 (UTC)
Light can be created with command createVehicleLocal with special vehicle class "#lightpoint"
for example:
_light = "#lightpoint" createVehicleLocal pos; _light setLightBrightness 1.0; _light setLightAmbient [0.0, 1.0, 0.0]; _light setLightColor [0.0, 1.0, 0.0]; _light lightAttachObject [_object, [0,0,0]];
Waffle SS. - c
Posted on Mar 31, 2015 - 04:49 (UTC)
When attached, movement is slow to update (jumpy). Use attachTo when attaching a light to moving objects.