Garry's Mod Wiki

GM:ShouldDrawLocalPlayer

Description

Called to determine if the LocalPlayer should be drawn.

Due to an optimization, this hook is only called once per frame (github issue). This is problematic if you need to have the player drawn only in certain contexts, such as within render.RenderView or based on the render target. As a workaround, you can call <kbd>cam.Start3D() cam.End3D()</kbd> within this hook to force the engine to call it every time.

If you're using this hook to draw a player for a GM:CalcView hook, then you may want to consider using the drawviewer variable you can use in your Structures/CamData table instead.

Arguments

1 Player ply
The player

Returns

1 boolean
True to draw the player, false to hide.

Page Links


Special Pages


Wikis

?

Render Time: 34ms

DB GetPage 3
Generate Html 11
SaveChanges 11
Render Body 0
Render Sidebar 6