• 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 /
  • Help Room /
avatar image
Question by johnniks · Apr 05, 2016 at 12:36 PM · canvascamerasscreenspace

How to use more than one camera for screen space camera?

Hello,

I want to use two cameras for the Screen Space Camera for my Canvas... how do I do that? So far it can only add one camera, but I need two cameras as I've made a 1st and 3rd person view mode, that I want to use the same HUD/UI.

Comment

People who like this

0 Show 10
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 sacee · Apr 08, 2016 at 02:42 PM 0
Share

Hi, can you explain in a bit more detail what you want to do?

avatar image johnniks sacee · Apr 09, 2016 at 06:20 PM 0
Share

Well, I've two cams (one for 1st and another for 3rd person view) but I can only attach one cam to the Screen Space Camera for the Canvas I'm using for my HUD.

I need a way to add both cameras to that so that I don't have to make a new HUD for each camera. But I don't know how to go about doing that... so far the only solution to me seems like I've to make a HUD for the 1st person cam and one for the 3rd person cam (separately). But I would really like to avoid this, and instead be able to use the same HUD for both.

Any suggestions?

avatar image sacee johnniks · Apr 14, 2016 at 03:53 PM 0
Share

Ok, so you have sth like a splitscreen and wan to have the canvas displayed in both halfs?

avatar image johnniks sacee · Apr 17, 2016 at 12:10 PM 0
Share

not a splitscreen... a switch... surely you must have played some games where you can switch between first person and third person views?

but yes, i want the same HUD to be displayed in both, I can do this by putting the canvas outside of the player (not making it a child off) but that results in a cluster fuck of gameobjects, so i would really like a way to still make it work when it's a child of the player... but because "Screen Space Camera" only allows me to put one camera in there, i don't know how to make this happen :/

avatar image Blue-Cut johnniks · Apr 17, 2016 at 03:36 PM 0
Share

Ok, I am not sure how you organized your scene, but I don't think your HUD should be a child of the player. I don't understand what you mean by this : "that results in a cluster fuck of gameobjects".

By default, when you create a UI object in your canevas, its layer is "UI Layer". And if your camera has "UI Layer" checked in its culling mask, so your UI will be displayed. The position of your camera in your hierachy is totally independant of the position of your canevas. You can have 50 different cameras in your scene that have 50 unique behaviour, and still they are all able to display the unique canevas (at the root of your hierarchy) in the same way.

avatar image Blue-Cut · Apr 14, 2016 at 06:24 PM 0
Share

I don't understand your problem, if your screen is split like sacee asked, you really should precise it in your question. All what your canevas elements are displayed in the "UI layer". So if your cameras both display UI layers elements, your HUD should be displayed no matter which camera is active.

avatar image johnniks Blue-Cut · Apr 16, 2016 at 02:37 PM 0
Share

if i use "Screen Space Camera" then i can only apply one cam, and because i'm using two cams (1st and 3rd) then i can't use that option.

so what can i do instead?

all i can do so far is either to:

1 make a HUD for each cam, since Screen Space Camera only allows me to add one cam.

2 put the HUD outside of the player, which i really want to avoid as i want to keep the HUD as a child of the player

PS. i'm not so sure why this is so hard to understand... i've said the same thing several times now in different ways :/

avatar image hexagonius · Apr 14, 2016 at 07:42 PM 0
Share

I'm not sure what kind of a UI we are talking about here, but you could use a 3rd camera to render the HUD while toggling between the other two or rendering them both. Use the Dont clear flag on it and you're good to go.

avatar image johnniks hexagonius · Apr 16, 2016 at 02:43 PM 0
Share

that sounds like a terrible way of doing it... surely it must be possible to put the Canvas/HUD inside the player gameobject as a child and still make it work?

avatar image Blue-Cut johnniks · Apr 16, 2016 at 03:32 PM 0
Share

This would be really strange that you have to do this. I have a big project where I need to use 4 different cameras and I never had any problem to display my HUD. I don't understand in what way 1st or 3rd camera would make any difference. Really need to test something myself to help you on this.

Are you absolutely sure that both your camera have 'Eveything' set in their Culling Mask ?

0 Replies

· Add your reply
  • Sort: 

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

57 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 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 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

Take XYZ of GameObject and convert that to canvas co-ordinates? 0 Answers

Sprite in Canvas not projected correctly in Maximum playmode 0 Answers

How set one canvas to two cameras 1 Answer

Unity UI does not visible when i drag using canvas set to screen space - camera 1 Answer

UI Mask strange behaviour on world space canvas 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