Forum rules - please read before posting.

First Person 3D - How does the camera setup work?

Hello there,

I've been using AC (currently on 1.64.1) for a few months now but one thing which has always bugged me is I still don't know how the camera relationship works. As in:

  • I have a player prefab with a First Person camera child object, which has an inactive camera component on it. This includes a First Person Camera script with things like bob head...etc

  • In the Hierarchy though there is a _Cameras object and an active Main Camera with a LookAt child. This main camera is active and seems for things like Post Processing this is where effects need to be applied.
  • If I disable the hierarchy Main Camera then Unity doesn't render anything, suggesting this is the most important camera.
  • But, if I remove the inactive camera component from the player prefab then Unity throws an error immediately on play:
image

I simply don't understand the relationship here. Why the two camera objects? Why is the inactive camera component needed on the player prefab?...etc

Would love to develop a better understanding of this setup!

Thanks.


Comments

  • edited August 2018
    The MainCamera is indeed the important one - and, unless you incorporate some separate camera system/asset - should be the only one active in your scene.

    The other camera's are merely used as references - see the Manual's "Cameras overview" chapter.  When you switch GameCamera, or rely on the FirstPersonCamera during gameplay, the MainCamera will adopt that camera's values every frame.  This includes position, rotation, but also camera-specific values such as Field Of View and Orthographic Size.

    This relationship is similar to that used by Cinemachine, whereby you have a series of "Virtual Cameras" but only one "Brain".
  • Awesome. Thank you for the explanation Chris.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.