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
2
Question by One · Aug 05, 2010 at 06:20 PM · cameramultiplayersplit-screenco-op

Any clues on how to create a split-screen effect like the lego harry potter game?

How would you create a split screen effect like the one from the latest Lego games (Harry Potter Years 1 - 4 and Indiana Jones 2), here is a video showing it:

http://www.youtube.com/watch?v=fnN7Gje7gbo The effect can be seen from 1:00

I want to create the effect of having the divisor line moving around the screen depending on the players position and when they reunite the perspective is the same for both cameras and looks seamless.

How would you suggest to create such effect?

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

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Novodantis 1 · Aug 05, 2010 at 06:49 PM

Unity draws viewports as rectangles as far as I'm aware, so I'd imagine the shifting diagonal effect would be tricky if not currently impossible. Perhaps if you render one of the views to a texture that fills the screen, you could shift an alpha mask around it to show parts of the view behind. No idea how well that would work, though. Alternatively you might be able to write your own extension to the camera, although I have no experience of such a thing; so again, not sure.

There are other ways you can split the view however, which are much more straightforward. Upon detecting your players are too far apart, you can create another viewport on top of the current one at the same size, drawn from a duplicate camera. Then, over a few seconds, reduce each viewport to half the screen each and you now have split screen.

To re-unite them, simply Lerp/Tween camera 2 to camera 1's position when the players enter a certain distance from each other. Once the cameras are pretty much aligned, you can remove the second view and return to one screen. This will not be as smooth as the example of course, but such are the perks of building your engine from scratch :)

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
1

Answer by Bampf · Sep 20, 2010 at 03:15 PM

Your video got taken down so I can't see the exact diagonal effect you refer to.

You could render the 2nd camera to a texture (Pro feature.) Then you can use a custom shader to compose the final texture that you show to the player. One of the inputs to the shader could be a mask; this would let you do arbitrary shapes. The Unify wiki has a custom shader that appears to do this.

You may be able to manage without a shader. You could use the 2nd camera's render texture as the texture on some shape (for example a triangle.) Then you'd put that shape in front of the main camera to show what the 2nd camera sees. You'd have to line it up perfectly with the camera view to avoid distortion, so I suspect the shader is the better solution.

I very much like Novodantis's idea of merging the views by lerping the cameras to the same point. Once they are together the views should merge.

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
1

Answer by waylonflinn · Feb 15, 2012 at 07:02 AM

This video on YouTube demonstrates the effect.

Unity3d dynamic two player split screen

The video by the same person shows the basic technique used to achieve it:

Unity3d Custom View Ports Part 1: Mini Map

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

2 People are following this question.

avatar image avatar image

Related Questions

Ignore rendering specific GameObject 1 Answer

How to make a split-screen? (2 cameras rendering at same time) 4 Answers

Multiple cameras such as in MarioCart 1 Answer

How to do a multiplayer split-screen game on one computer? 5 Answers

Multiplayer - Players have wrong cameras 1 Answer


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