Facepunch / garrysmod-requests

Feature requests for Garry's Mod
86 stars 24 forks source link

Bind NPC:PlayerHasIlluminatedNPC to Lua #2236

Closed DrVrej closed 11 months ago

DrVrej commented 11 months ago

Details

PlayerHasIlluminatedNPC(ply, losDotProd)( Link ): Called when the player's flashlight is illuminating onto the NPC. This is used in certain NPCs in HL2. It would be a much better way to determine if the player is shining a flashlight onto an NPC then the current existing Lua alternatives (Which can be performance heavy and unreliable)

robotboy655 commented 11 months ago

This relies on episodic behavior that is not present in GMod, and it doesn't really do anything special compared to what you might be doing. It's just a distance and Dot product check.