Garry's Mod Wiki

Revision Difference

Player:GetViewEntity#547981

<function name="GetViewEntity" parent="Player" type="classfunc"> <description>Returns the entity the player is using to see from (such as the player itself, the camera, or another entity).</description>⤶ <description>Returns the entity the player is using to see from (such as the player itself, the camera, or another entity). <note>This function will return a [NULL Entity] until <page>Player:SetViewEntity</page> has been used</note></description>⤶ <realm>Shared</realm> <rets> <ret name="" type="Entity">The entity the player is using to see from</ret> </rets> </function> <example> <description>Will print what entity the first player uses to look through.</description> <code>print( Entity( 1 ):GetViewEntity() )</code> <output>Player [1][ExamplePlayer]</output> </example>