GM:ShouldDrawLocalPlayer

From Garry's Mod
Jump to: navigation, search
 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 cam.Start3D() cam.End3D() within this hook to force the engine to call it every time.

NOTE 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 CamData structure table instead.

Arguments

Player ply

The player

Returns

boolean

True to draw the player, false to hide.
Personal tools
Navigation