1
\$\begingroup\$

How can a first person object character be made to be the primary viewing camera in unityscript? Do I remove the main camera? or just turn one or the other on/off?

\$\endgroup\$
3
  • \$\begingroup\$ I believe the Unity first person controller prefab sets its own camera to the default. So you should be able to delete the default "Main Camera" object that is created when you open a new scene. \$\endgroup\$ Commented Jul 23, 2013 at 21:55
  • \$\begingroup\$ It's also worth noting that the whichever camera you intend to use as the "first-person" camera should be a child of the character game object. Remove any other cameras. \$\endgroup\$ Commented Sep 27, 2013 at 15:10
  • \$\begingroup\$ Instead of removing all other cameras, I'd learn about camera depths, and then remove unnecessary cameras: docs.unity3d.com/Documentation/ScriptReference/… \$\endgroup\$
    – user15805
    Commented Sep 27, 2013 at 16:24

2 Answers 2

1
\$\begingroup\$

Unity will use the first camera tagged as MainCamera, so you'll need to change the tag of the camera you want to be main and remove the tag from the old main (or just delete it).

\$\endgroup\$
1
\$\begingroup\$

If you have more than 1 camera in the scene you will have to change their Depths accordingly.

Also, unless you have a specific reason for having more than 1 camera (for example, render textures, GUI camera, split screen, etc) you should just delete any unnecessary cameras.

And to access Camera.main you should simply tag your camera as Main Camera.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .