Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
1
Question by Ljrnet · Aug 19, 2019 at 04:01 AM · shadersscene-switchingscene-change

Slide between scenes

Hey guys, I would like to make a scene transition where the first scene slides out of the way showing the second scene behind it. This would require two scenes to be loaded at the same time. Here's an example of what I'm looking to create.

https://youtu.be/ao4CP_Cv1Y0

I'm not sure how to go about this and help would be much appreciated. Thanks in advance.

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 Pangamini · Sep 17, 2019 at 01:03 PM 0
Share

Well, where did you get with your research?

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by Santifocus · Sep 17, 2019 at 02:07 PM

There are two ways i can think of one easier but more restricted and one a little harder but should be flexible:

1: You know how the first frame in the second scene looks like so you would make a screenshot of some sort. Then when you intend to change the scene you preload the second scene, when it is done you do some nice transitional UI stuff e.g. a 2D mask that reveals the screenshot you created beforehand, and when the screenshot is fully revealed you jump over to the next scene.

Related but probably not what you are looking for: https://www.youtube.com/watch?v=Oadq-IrOazg

2: You dont know how the first frame of the second scene looks like or it might vary based on different situations. Okay dont take my word for this because i didnt try this. You can load Scenes addatively in other words you can have 2 scenes active at the same time you would then need to acces the two cameras from which the player views the scenes and make use of the "Viewport Rect" attribute on those cameras.

Something like this. (Not tested)

     private IEnumerator TransitionCameras()
     {
         float transitionSpeed = 0.5f;
         float transitionPoint = 1;
 
         Camera firstSceneCamera = null; //put your cameras here
         Camera secondSceneCamera = null;
 
         secondSceneCamera.rect = new Rect(transitionPoint, 0, 1, 1);
 
         while(transitionPoint > 1)
         {
             yield return new WaitForEndOfFrame();
 
             transitionPoint -= Time.deltaTime * transitionSpeed;
 
             firstSceneCamera.rect = new Rect(1 - transitionPoint, 0, 1, 1);
             secondSceneCamera.rect = new Rect(transitionPoint, 0, 1, 1);
         }
 
         secondSceneCamera.rect = new Rect(0, 0, 1, 1);
         //Unload old scene here
     }

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 Ljrnet · Sep 18, 2019 at 12:13 AM 0
Share

Thanks for the reply. I'll give it a try and let you know if it works.

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

123 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity Scene loading problem (slow loading until it freezes) 0 Answers

Re-loading a scene but on the background older scenes are displayed 1 Answer

Fadeout Issue 0 Answers

How to make Set Active true when scene loads 1 Answer

Get a float transferred between two scenes and scripts 3 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