Entity.SetNoDraw
From GMod Wiki
Function | |
Syntax | Entity:SetNoDraw( Boolean shouldNotDraw ) |
Description: | |
Allows you to set whether an entity is drawn or not. Passing true will stop the entity from drawing. Passing false will allow the entity to be drawn. | |
Returns: | nil |
In Object: | Entity |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Entity.SetNoDraw]Entity.SetNoDraw [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Show an Entity |
---|---|
Used on | |
Code | Entity:SetNoDraw( false ) //Shows the Entity |
Output | The entity will now be drawn |
Description | Hide an Entity |
---|---|
Used on | |
Code | Entity:SetNoDraw( true ) //Hides the Entity |
Output | The entity will not be drawn |
Additional Notes
- If called clientside, this will stop the physics prediction on that entity, use Entity:SetModelScale(Vector(0)) instead
- In regular entities, this will stop the model from being drawn along with any effects generated in the entity (ropes, beams, sprites, etc)
- In scripted entities, this stops the ENT:Draw() hook from being run.
- Entity:DrawModel can be run on a no-draw entity manually (for example, if you want to draw it's model in the sky or on a VGUI control).
- Use Entity.CreateShadow to make the shadow reappear if you're making an entity visible again.
- If this is set to true serverside before the client is aware of the entity, the entity is never sent to the client.