• I'm trying to create a flashlight entity using projectedTextures
    2 replies, posted
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]
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Global/ProjectedTexture]ProjectedTexture[/url] (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()!
Sorry, you need to Log In to post a reply to this thread.