Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by Bayreuth · Sep 08, 2013 at 03:52 PM · cameramain camera

How to set a a Camera as a main camera

Hi

i have a problem with my cameras. i´m making a game like uncharted and when the player presses a button a the cam should switch to another one and shows that the door is open and then switch back to main cam. but when i start my game it switchs to the other cam. how can i set the main camera to be shown when i start the game?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer Wiki

Answer by ZouBi27 · Sep 09, 2013 at 02:03 AM

Enable the camera you want to show and disable all others camera.

camera1.camera.active = false; camera2.camera.active = true;

Don't only use the depth property of the cameras. If you don't disable other cameras you don't use, you'll have twice the draw calls.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
6

Answer by eddyzy · Sep 08, 2013 at 04:02 PM

the camera with the lower depth wil be the first to render.

your main camera will be the one with the lower depth.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bayreuth · Sep 08, 2013 at 04:11 PM 2
Share

this didnt work my main cam has -1 and the other one 0 Edit: The $$anonymous$$ain Cam is the one with the higher depth

avatar image eddyzy · Sep 08, 2013 at 04:22 PM 0
Share

sorry my bad is the other way around the camera with the highest depth wil be the first to render. eg one has -1 the other 0

the one with the 0 will render

avatar image MrProfessorTroll · Sep 09, 2013 at 02:13 AM 0
Share

$$anonymous$$ake sure the tag is also "$$anonymous$$ainCamera"

avatar image Tenebrous · Dec 07, 2014 at 10:59 AM 0
Share

Yeah it has /nothing/ to do with the camera's depth - it is always the first camera with a tag of $$anonymous$$ainCamera - it will be null if no cameras have that tag.

avatar image nofreewill42 Tenebrous · Jun 09, 2020 at 03:17 AM 0
Share

Now it seems that it is the Depth that tells which camera should be the main.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

19 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Scene Window Mouse Controller Mimic ? 1 Answer

character view range 2 Answers

,the associated scrip cannot be loaded error on FPScontroller prefab from the standard assets 0 Answers

I want to put main camera floating 0 Answers

Main Camera Stops working or just freezes? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges