I'm trying to create a flashlight entity using projectedTextures

Hello

I’ve been trying to create a flashlight entity that has a projected texture parented to it, making it a dropped flashlight turned on.
I get an error: “Tried to use a NULL entity!”
What am I doing wrong?

Here’s the (serversided) code:
[lua]
local light = ProjectedTexture()
light:SetEnableShadows( true )
light:SetTexture( “effects/flashlight001” )
light:SetFOV( 50 )
light:SetFarZ( 512 )
[/lua]

ProjectedTexture (its only clientside function)

The error you mentioned cannot occur with the code you posted, as far as I know. Which line are you getting it on?

[editline]26th December 2016[/editline]

This is unrelated, but don’t forget to call light:Update()!