Entity.Visible
From GMod Wiki
Function | |
Syntax | Entity:Visible( Entity eOtherEnt ) |
Description: | |
Returns true if this entity can "see" the second entity, and false otherwise. See additional notes for important information on this function. | |
Returns: | Boolean |
In Object: | Entity |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Entity.Visible]Entity.Visible [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Additional Notes
- This function uses PVS to determine if this entity can "see" another entity. When a map is compiled, it divides the map into sectors called "visleafs". Each visleaf has a PVS, or potentially visible set, which is a list of other visleafs the compiler has determined that visleaf can see. If another entity is visible to this entity, it means one of the following is true:
- A. Both entities are in the same visleaf
- B. This entity's visleaf is in the PVS of the other entity's visleaf
- C. The current map was compiled without VVIS and has no visleafs, so everything is "visible" to everything.