Revision Difference
Camera#548393
<cat>Code.Camera</cat>
<title>Camera</title>
# Introduction
⤶
# Introduction
You can control the game camera by referencing the global clientside variable `Camera`. It is accessible and changeable anywhere in the game loop clientside.
# Example usage
It is recommended to put your camera code in an event called every frame such as `[Event.Client.Frame]` or `[Event.Client.PostCam]` [Event System](https://wiki.facepunch.com/sbox/EventSystem), or a method such as `FrameSimulate`⤶
It is recommended to put your camera code in an event called every frame such as `[Event.Client.Frame]` or `[Event.Client.PostCamera]` (see [Event System](EventSystem) for more info) - or a method such as `FrameSimulate`:⤶
```
public override void FrameSimulate( Client cl )
{
Camera.Rotation = ViewAngles.ToRotation();
Camera.Position = EyePosition;
Camera.FieldOfView = Local.UserPreference.FieldOfView;
Camera.FieldOfView = Game.UserPreference.FieldOfView;
Camera.FirstPersonViewer = this;
Camera.ZNear = 1f;
Camera.ZFar = 5000.0f;
}
```