User Tools

Site Tools


4rpl:commands:setbeamwidth

Index
<- Beams

SetBeamWidth

SetBeamWidth(<-beamUID <-width)

Description

Set a beam's width. The width is the thickness of the beam. Beams are made from flat geometry that attempts to face the player camera (as best it can). Because of this it is generally better to keep width relativly small (under 10 in most cases).

:NOTE: Beams become very difficult to see from long distances when they are a size lower than 0.35 so if you want the beam to always be visible, keep the width at a minimum of 0.35.
This can also be useful when using a large number of beams such as targeting lasers for decorating purposes rather than functional purposes to ensure the player's screen is not flooded with beams when zoomed out when using many of that unit.

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
 
GetUnitUpdateCount mod (5) ->width
SetBeamWidth(<-beam <-width)

Index

4rpl/commands/setbeamwidth.txt · Last modified: 2022/07/26 00:57 by Vertu