Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Google Cardboard Fade in/out for scene shifting.

Discussion in 'VR' started by Ashwin_Deepak, Apr 20, 2023.

  1. Ashwin_Deepak

    Ashwin_Deepak

    Joined:
    May 17, 2022
    Posts:
    24
    So I have tried the method of scene shifting in Google Cardboard by changing the alpha value of black Canvas UI to act as Fade in/out but in the laptop game scene it works fine, but when you build it to android there is smooth transition between the scenes. You can see the Fade transition being glitched. Also how is it possible to apply Overlay Canvas for both the eyes...

    Please let me know a good method for scene transitions for Google Cardboard VR....
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,846
    What do you mean with glitchy?
    What shader is used for the image if any?
    Which unity version is used?
     
  3. Ashwin_Deepak

    Ashwin_Deepak

    Joined:
    May 17, 2022
    Posts:
    24
    Unity version : 2021.3.22f1
    Shader for the image:
    Am using a World space Canvas with the below settings
    upload_2023-4-21_14-3-31.png

    Glitchy I meant is in the laptop I can see the Fade in/out transition smoothly but in mobile its like not smooth.

    The below is what i see in laptop game view
    https://drive.google.com/file/d/1Gl8-tLfts-C5PJ-jB049aPPbvBEcB3Qx/view?usp=sharing

    The below is my phone view
    https://drive.google.com/file/d/1tK4QAHzdPo_CEBoD1hk6LAs_ft1U24Zg/view?usp=sharing

    Let me know a good method for scene transition in Unity.
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,846
    The laptop one also does not seem perfectly smooth. Share your code
     
  5. Ashwin_Deepak

    Ashwin_Deepak

    Joined:
    May 17, 2022
    Posts:
    24
    I am using animation to change the alpha value of that black screen

    Is there another method for fade in/out for VR using Google Cardboard?

    LevelLoader is in the Parent Game Object
    Blackscreen code is in the Canvas

    upload_2023-4-21_14-55-9.png
     

    Attached Files:

    Last edited: Apr 21, 2023
  6. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,846
    I suggest using LateUpdate and fade it there via code
     
  7. Ashwin_Deepak

    Ashwin_Deepak

    Joined:
    May 17, 2022
    Posts:
    24
    "Fade it there" how? am sorry didnt get you
     
  8. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,846
    Lerp the alpha of the color.
    If you google for screen fade examples (even for VR), you can find scripts doing this
     
    Ashwin_Deepak likes this.
  9. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,271
    Ashwin_Deepak and DevDunk like this.