Index
Beams

SetBeamEnd

SetBeamEnd(<-beamUID <-end)

Description

Set a beam's vector ending position in 3D space. For an unattached beam, the ending coordinates are in world space. This means that 0,0,0 is in the lower left of the map. The endY coordinate is the height above the terrain and endX is along the right/left direction of the map and endZ is the forward/back direction. For a beam that is attached to a unit, the end position REMAINS IN WORLD COORDINATES unless the beam has been set to SetBeamForceLocalEnd.

Important note: If you are planning to create a continuous beam on a unit that will be moving while firing, do not attach the beam to the unit. An attached beam will be unable to maintain the correct visual orientation and length. An unattached beam so long as its' start location is updated will retain a correct visual orientation.

Examples

once
   GetUnitPosition(self) ->unitPos
   #Fire a beam to extends off screen but is at the same height as the unit
   #We will attach the beam to ourselves, so that the start point is relative to our unit
   3 ->brightness
   4 ->width
   CreateBeam("orange" <-brightness <-width) ->beam
   AttachBeam(<-beam self "")
   SetBeamStart(<-beam V3(0 0 0))
   SetBeamEnd(<-beam V3(10000 0 10000))
endonce
 
SetBeamEnd(<-beam V3(100 <-unitPos.Y 100)) #Move the end of the beam to point at 100,unitY,100 on the map.

Index