• Using ENTITY:RenderOverride
    4 replies, posted
The sandbox spawn effect (the little refraction effect that you see when you spawn an entity) works by setting ent.RenderOverride to a function within the effect itself. It doesn't do anything to the entity, it doesn't set it every think, it just sets it. However, whenever I set RenderOverride for an entity, nothing happens. Any ideas on how to make this work?
This is what I do for my vehicle spawn after I do local vehicle = ents.Create... : [lua]local effectdata = EffectData( ) effectdata:SetOrigin( vehicle:GetPos( ) ) effectdata:SetStart( Vector( 0, 0, 255 ) ); effectdata:SetAttachment( 1 ) effectdata:SetEntity( vehicle ) util.Effect( "propspawn", effectdata ) effectdata = nil;[/lua]
[QUOTE=Acecool;41757306]This is what I do for my vehicle spawn after I do local vehicle = ents.Create... : [lua]local effectdata = EffectData( ) effectdata:SetOrigin( vehicle:GetPos( ) ) effectdata:SetStart( Vector( 0, 0, 255 ) ); effectdata:SetAttachment( 1 ) effectdata:SetEntity( vehicle ) util.Effect( "propspawn", effectdata ) effectdata = nil;[/lua][/QUOTE] yes, this is how you call the GMod spawneffect. What I was asking was [U]how to use ENT:RenderOverride on a non-scripted entity[/U] ([I]like the spawneffect does.[/I])
Pretty sure that, per definition, if you're scripting an entity it becomes a [I]scripted[/I] entity.
[QUOTE=EvacX;41770771]Pretty sure that, per definition, if you're scripting an entity it becomes a [I]scripted[/I] entity.[/QUOTE] I am trying to change the way [I]any[/I] entity, whether an entity scripted in GMod Lua or an entity built into Source, renders using the RnderOverride function. Whenever I try to use it on a non-scripted entity, nothing happens.
Sorry, you need to Log In to post a reply to this thread.