ENTITY/RenderOverride

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m
Line 4: Line 4:
 
This hook works on any entity (scripted or not) it is applied on.
 
This hook works on any entity (scripted or not) it is applied on.
  
'''NOTE:''' As a downside of this implementation, only one RenderOverride may be applied at a time.
+
{{Note|As a downside of this implementation, only one RenderOverride may be applied at a time}}
 
|Realm=Client
 
|Realm=Client
 
|Predicted=No
 
|Predicted=No

Revision as of 08:16, 28 April 2016

 ENTITY:RenderOverride( )

Description

Called instead of the engine drawing function of the entity.

This hook works on any entity (scripted or not) it is applied on.

NOTE

As a downside of this implementation, only one RenderOverride may be applied at a time

Examples

Example

Don't draw the entity we've picked if we're its owner.

local function DontDrawMe( self )
	if ( self:GetOwner() == Entity(1) ) then
		return
	end
	
	self:DrawModel()
end

local pickent = Entity(1):GetEyeTrace().Entity

if ( IsValid( pickent ) ) then
	pickent.RenderOverride = DontDrawMe
end


Personal tools
Navigation