Custom Camera

Info

If you want to add your own camera solution, follow these steps:

Steps

  1. Create a new MonoBehaviour script & implement the class that derived from CameraBase & add it to the root of your custom camera (the code example in the Code Example section below).

  2. Find the UIInstaller object on the scene.

    _images/CustomCameraExample1.png
  3. Assign the new camera to the Main Camera Base field.

    _images/CustomCameraExample2.png
  4. Create a Cull point child for the new camera by adding a CullPointRuntimeAuthoring to the new gameobject.

  5. Make sure you have deleted or disabled the old camera.

Code example

    // The new MonoBehaviour script that derived from 'CameraBase'
public class ExampleCamera : CameraBase
{
            // Your own camera solution example
    public vThirdPersonCamera cam;

            // Injecting PlayerActorTracker via Zenject (mandatory code)
    [Inject]
    public override void Construct(PlayerActorTracker playerActorTracker)
    {
        base.Construct(playerActorTracker);
    }

            // Override this event method to set target for your custom camera, pseudo code example:
    protected override void PlayerActorTracker_OnSwitchActor(Transform newPlayerActor)
    {
                    // Set the player transform target
        cam.SetTarget(newPlayerActor);
    }
}