point_spotlight
![]() |
---|
CPointSpotlight |
![]() |
point_spotlight
is a point entity available in all Source games. Creates two glow sprite effects: a beam effect for viewers outside the light cone and a halo effect for viewers inside the cone. Also creates dynamic light at the end of the beam if desired flags are set which is achieved using spotlight_end.
The spotlight_end functionality can be disabled with the 'No Dynamic Light' spawnflag. In that state, the spotlight will not actually illuminate other objects on its own and can be used with an accompanying light_spot or env_projectedtexture instead.



renderamt
is not functional at all, use HDRColorScale
instead.


point_spotlight
itself has been converted to a server-only entity (does not take up an edict), and in 
point_spotlight
and spotlight_end
entity is also killed, thus consuming 1 edict in total for a static spotlight.
![]() ![]() ![]() ![]() |
Keyvalues
- Name (targetname) <string> [ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentname
ortarget
).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
- Ignore Solid (IgnoreSolid) <boolean> (in all games since
) (also in
, !FGD in
)
- If set, this spotlight won't trace for solids, emitting at its full length and ignoring potential obstructions.
- Spotlight Length (SpotlightLength) <integer>
- Length of the spotlight beam.
- Spotlight Width (SpotlightWidth) <integer>
- Width of the spotlight beam.
- Color (R G B) (rendercolor) <color255>
- Spotlight color.
- HDR color scale. (HDRColorScale) <float>
- Float value to multiply sprite color by when running in HDR mode.
- Halo size scale. (HaloScale) <float> (in all games since
) (also in
)
- Float value to determine the size of the halo.
|
Flags
- Start On : [1]
- No Dynamic Light : [2]



function L4D2PointSpotlightFix() {
for(local ent; ent = Entities.FindByClassname(ent, "spotlight_end");) {
if(NetProps.GetPropEntity(ent, "m_hOwnerEntity") == self) {
local clrrender = NetProps.GetPropInt(self, "m_clrRender");
NetProps.SetPropInt(ent, "m_clrRender", clrrender);
return;
}
}
}
function OnPostSpawn() {
if((NetProps.GetPropInt(self, "m_spawnflags") & 3) == 0) {
L4D2PointSpotlightFix();
}
self.ConnectOutput("OnLightOn", "L4D2PointSpotlightFix")
}
Inputs
- LightOn
- Turn the spotlight on.
- LightOff
- Turn the spotlight off.
- SetColor <color255 > (in all games since
) (also in
)
- Change the color of the spotlight. Light must be turned off then back on for dynamic light to update.
Note:Functionally identical to the Color input. A delay of at least 0.01 is required before the spotlight is turned back on, or else it will remain off.
- ForceUpdate (in all games since
) (also in
)
- Force an update of the spotlight position and orientation.
Outputs
- OnLightOn
- !activator = !caller = this entity
Fires when light turns on.
- OnLightOff
- !activator = !caller = this entity
Fires when light turns off.
By default, point_spotlight uses the material sprites/glow_test02.vmt. You can change this if you are shipping your own binaries by going into point_spotlight.cpp in the server project, navigating to line 351 and replacing the file path with your own material or a reference to a variable set via a KV similarly as Mapbase's SpotlightMaterial KV.