Player:GetViewEntity
Description
Returns the entity the player is using to see from (such as the player itself, the camera, or another entity).
This function will not return the currently spectated entity. See Player:GetObserverTarget.
Returns
Example
Will print what entity the first player uses to look through.
Output: Player [1][ExamplePlayer]
Garry's Mod
Rust
Steamworks
Wiki Help