Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by cnepoy · Nov 26, 2014 at 08:48 PM · cameracamerassplit-screen2 player

Want two cameras to display the scene differently

I am building a simple 2D split screen game. All of the players start at the same location, but look different. Right now, one player is in front of all of the other players.

I want the player that is in front of all of the other players to vary between cameras. I would like player 1's camera to display player 1 on top, players 2's camera to display player 2 on top, etc.

Is this possible?

Comment
Add comment · Show 1
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 cnepoy · Mar 14, 2015 at 01:53 AM 0
Share

I know it has been a long time since I posted on this, but I have been busy.

Neither of the links you posted address what I am trying to do. $$anonymous$$aybe I didn't not explain well enough.

alt text

Here we have Player1 ahead of the other players. There is no problem, because he is at a different location as them. Players 2, 3, and 4 are on the same location, though. This is great for player 4, because player 4 is on top of all the players, but I would like it to be that a player is on top on their own screen.

In other words, I would like DUBZZ to be on top in the top-right screen, GRANT on top in the bottom left screen, and $$anonymous$$ARAN on top in the bottom right screen.

I also want it to be the case that the other players are still displayed on every screen, just that the player whose screen it is will always be on top if there is such a collision.

Is this possible? Please help

screen-shot-2015-03-13-at-104130-am.png (476.8 kB)

3 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by maccabbe · Mar 13, 2015 at 09:23 PM

There are a few ways to do this.

1) Have a foreground and background player object for each player. Each pair of gameObject would both move and act the same way as a single player object. However each object has a z position so all foreground objects are on top of all background objects and all objects are on different layers (let's call them fg1, bg1, etc). Then each camera would only show 1 foreground and 3 background layers, depending on the camera. For instance player 1's camera would show fg1, bg2, bg3, and bg4 layers. Since the gameObjects in the foreground layer are in front of the gameObjects in the background layer this means player 1 would always be in front for player 1. Do the same for the other three players (except switch fg1 with bg1 and bg# with fg#).

2) Use two cameras, a foreground and background camera for each player camera. Assign the foreground camera to draw after the background camera. Then put each player on a different layer. Have player 1's background camera only draw the layers player2, player3, and player 4 and player 1's foreground camera draw the layer player1. This will create the effect that player 1 is always on top of the other 3 players. Do the same for the other 3 players.

Comment
Add comment · Show 1 · 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 cnepoy · Mar 13, 2015 at 10:36 PM 0
Share

That's brilliant!! Thank you so much

avatar image
0

Answer by Landern · Nov 26, 2014 at 08:49 PM

Search and you will find this is common:

http://forum.unity3d.com/threads/2-cameras-running-the-same-time.44911/

http://answers.unity3d.com/questions/10206/how-can-i-show-split-screen-or-multiple-camera-vie.html

Comment
Add comment · Show 1 · 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 cnepoy · Nov 27, 2014 at 08:19 AM 0
Share

I do not think that these answer my question. They seem to address the idea of having two cameras in different locations. I already have the cameras following the appropriate players, I just want the appropriate player to be on top of the other ones.

The first link talks about having two cameras in the same scene, but with different perspectives. I have the perspective part figured out, I need two cameras to be looking at the same players, but camera 1 displays player 1 on top of player 2 and camera 2 displays camera 2 on top of player 1.

The second link is just talking about making a split screen game with two cameras, which I have already figured out.

avatar image
0

Answer by bubzy · Nov 27, 2014 at 08:57 AM

alt text


layers.jpg (38.5 kB)
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

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How does Clear Flags on cameras work? 2 Answers

RenderPipelineManager.endCameraRendering only affects ViewPort-camera 1 Answer

How to switch back a camera after an interval using a Trigger 0 Answers

How can I switch between two cameras ? 1 Answer

2 Cameras layer wont render till i turn it off/on 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