General Workflow

The Standard defines the basic aspects of the player camera's behavior (e.g. positioning, orientation, collisions etc.). It also defines the avatar, controlled by the player. The main idea is that the player is identified with the player camera, therefore all the components that allow the user to interact with the game, are contained in the object of the player camera (as displayed below):

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/55489b5a-cf24-4fcf-9d6d-e511861c95aa/Untitled.png

In other words, the player camera is the player's communication point with the game world that, in turn, consists of objects, which could be conveniently classified into two categories: controlled and uncontrolled. Controlled objects (i.e. avatars) could be taken under control by the player camera. To do so, it has to position itself inside the avatar according to the scene's hierarchy. Depending on the controlled avatar, the player camera loads the relevant interface (i.e. Avatar layout) and implements the settings of the overview active mode. In case the player camera does not control the avatar, it loads its own interface, and the player goes to free-look mode (i.e. obtains the ability to move and rotate freely).

Apart from the player camera, avatar can be controlled by the AI component (turning avatar into NPC), and in case of playing online, avatar can also be controlled by another player. It is also possible that the player camera in positioned inside several avatars (e.g. when the controlled character takes control of the vehicle). In that case the player camera controls the avatar of the highest level of the hierarchy.

Standard's components are detailed below.

Player Camera Controller

PlayerCameraController component is responsible for the behavior of the controlled character, loading of avatar's interface, avatar's collisions and camera's active mode. Component's logic is being performed at the moment of initialization of (Start()), as well as at the moments of relocation in scene's hierarchy (OnTransformParentChanged()). As the name implies, component is attached directly to the object of player camera, and is not added to avatars. In the Editor, PlayerCameraController looks as follows:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/ab42b42f-10ba-4a76-90fb-3402910598e4/Untitled.png

Controllable Avatar field is a reference to AvatarOverallInput component of a controlled avatar that is defined by PlayerCameraController itself. Avatar Layout Parent field is a reference to Rect transform that will contain the interface of a controlled character. This field is used by the Standard of input configuration to additionally load control settings for the relevant player.

Camera View Controller

CameraViewController component is responsible for the calculation of camera overview (position, orientation, field of view and calculation of collisions with the environment) depending on the settings of the overview mode. Just as PlayerCameraController, CameraViewController is attached to the player camera's object, and its Editor looks as follows:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/993bde97-bcd3-43a8-9a05-3279909d1348/Untitled.png

View Delta Direction field contains the name of input field for AvatarOverallInput component that, in turn, is responsible for the control of avatar's overview.

Is In Selection Cycle parameter is used by CameraViewConfiguration component and is described in respective section.

Origin parameter holds the reference to Transform, the location of which is the center of the camera overview. Origin Up Source and Origin Forward Source parameters are used to adjust the sources of "up" and "forward" axes for the player camera, which are used to calculate the camera's turns. Origin Up Source parameter can take one of the following values: