For anyone having the same problem as I had, I believe that it is bcs of a newer version of Unity or maybe the material itself, but if you try the fadeIn action and can't try changing the name of the material you are calling from "_Color" to "_BaseColor"
Exactly what I needed when I needed it, suggestion, I used post processing volumes for my fading instead of a quad, and it's much nicer because you can add stuff like zoom and bloom
You should really make an announcement video on main, as a long time viewer (and patreon sub, though I hadn't checked in a while) I had no idea this channel existed! Great video as always :)
Thanks for the video. Note one thing this makes the controller rays dissapear (laser pointers). Possibly best way is to disable the fader quad all together and then enable it only when required. I believe the XR rig its fighting/blocking the laser pointer rendering. I think its becasue the shader you provided does not compensate for the render queue but my knowledge is limited on shaders. This is on Standard Render Pipeline. I did try scaling the quad to .1 and changing material render queue to no avail.
Thanks. I have been looking for a way to fade XR scenes for a while. This seems to be the answer. Fade out works great but, for some reason, fade in happens in a flash no matter what duration I set.
Hello (on va parler en anglais vue que c'est la langue de cette chaine 😅). The second method is THE approach to deal with if you have a big scene yes! Thx for the video you have made big progress since the begining of your videos
Merry Christmas! Great tutorial as always. Fade mechanism is very useful in VR. I am currently trying to prevent user from looking through the walls. Not sure how to do it, but I'll probably need to use some kind of collider attached to user's camera. The fading mechanism will also be usefull, I can block user's vision when he tries to pass through the wall :D
I was thinking the same thing. Whats to stop the player from cutting through other objects? I think setting the render on the fade object really high would work. Did you find a solution?
Good one. I'll use some of this for the next Cactus Cowboy VR game. It's much less complex than the spaghetti code I did for my fader. Note for others; You also use this quite easily as a damage vignette / indicator.
The FaderScreen seems to not only block ray interactors, but also the UI canvas. As a quick fix for this, I modified the SceneTransitionManager to set the FadeScreen GameObject to be active only during the fade, and inactive otherwise: public class SceneTransitionManager : MonoBehaviour { public FadeScreen fadeScreen; private void Start() { StartScene(); } private void StartScene() { StartCoroutine(StartSceneRoutine()); } private IEnumerator StartSceneRoutine() { fadeScreen.gameObject.SetActive(true); fadeScreen.FadeIn(); yield return new WaitForSeconds(fadeScreen.fadeDuration); // set FadeScreen to inactive, to prevent blocking ray interactors and UI canvas fadeScreen.gameObject.SetActive(false); } public void GoToScene(int sceneIndex) { StartCoroutine(GoToSceneRoutine(sceneIndex)); } private IEnumerator GoToSceneRoutine(int sceneIndex) { fadeScreen.gameObject.SetActive(true); fadeScreen.FadeOut(); yield return new WaitForSeconds(fadeScreen.fadeDuration); SceneManager.LoadScene(sceneIndex); } }
Great video! Would love to see a save and load function that works in VR, having a hard time understanding how to save and load position and rotation or even variables when transitioning scenes instead of having to restart the whole scene.
@ValemTutorials thank you this is great. I have implemented this method in my VR game, the fade in and and out works great. The Async of the scene is not working. I still get a little freeze hang time after one scene fades out and before the fade in on the next scene starts. Do you think you could help me to understand why? I get no errors so I am not sure what's going on. But it seems that there is no Async loading while the fade out is happening. The Async method is exactly has you done it in the video - and is implemented correctly in the UI buttons. Thank you
Hi bro, nice work, why doesn't Visual Studio recognize the 'Color' and 'Renderer' parameters, what library or resource do I need to have installed for it to work? I'm trying to develop something in VR and I have installed everything I need in theory, but I don't know what happen.
I am using OVR Rig and Ray Interactor SDK for UI when i created Screen Fader by following you, the ray interactor is not accessing UI elements, How can i fix this problem.
hi i am totally beginner,i am looking for that but i need to do that from beginning how to put cube button scene .is it a one video or its has other series as well
What about when the scene is not empty and the game chuggs even with this solution? How would you control or prevent player from fading too soon, due to awake and start functions? We have tried delaying the fade out a few seconds after and it would still chugg.
Was trying to do this for a few days. Thanks. The FadeIn() was going a little fast for me so I added this code to update and added a public float. This adds a time the screen is all black before transition. Took off FadeIn() on Start. public float timerFadeIn = 2f; void Update() { StartFadeIn(); } void StartFadeIn() { timerFadeIn -= Time.deltaTime; if (fadeOnStart && timerFadeIn
Any idea as too why my Ui elements show through the quad? (text and images can been seen through the quad when the renderer is set to 1?) Not too bad as it me made look into fading my Ui which has give me more control over the looks of my game.
Hello Valem, awesome tutorial as always. Even though the scene loading is done asynchronously, there is usually still the default hourglass icon from oculus appearing and the music still freezes on the transition. How could this be resolved?
Thank you so much for the tutorial!! I would like to ask how to make the Box Collider with a trigger to work with this Scene Transition Manager script? I want to create that a character touches a portal and transits to another scene. it would be great to add an additional tutorial about scene change with different interactions involved! millions thanks again!!
Create a box collider, set it to is trigger = true, create a script attached to the box collider with OnTriggerEnter, And if the collider entering the box collider is the one on the hand of the player you can simply call the GoToScene function to transition to a new scen. :)
Hi I am facing an issue with this fader screen my UI rays don't appear while this fader layer is on but teleportation ray works. any idea why this must be happening ?
@@TkMe2Mrz Possibly best way is to disable the fader quad all together and then enable it only when required. I believe the XR rig its fighting/blocking the laser pointer rendering. I think its beacsue the sahder provided does not compensate for the render queue but my knowledge is limited on shaders.
Hey great tutorial! Is there a way to prevent really bad lag and stuttering when the quad is infront of the camera? The fade works great but as soon as the quad has faded out looking around my scene becomes incredibly jarring. Any help would be greatly appreciated. Thanks
@@ValemTutorials Thank you for your response! I'll try that. What would the easiest way to implement it be do you reckon? As i'd need to have it reactivated for when the user would want to switch back to the original scene. Thank you again for your repsonse
Thanks for the tutorial bud! its amazing. by the way, is there any way to fix the controller material? if I change it to different material, it will not change the valid and invalid color gradient anymore. Like in your video, it will always stay black line
@@elenix4082 Interesting. I just changed my script so that when my Fade is done, the Fader gameobject turns off which shows my raycast and when I go to load a level it turns it back on which keeps everything working. I think I like your solution more haha
@@elenix4082 @Luigi Nicastro Thank you for saying this! We are using BOTH of these fixes. Changing the quad to a world space UI canvas and UI image (attached to the Main Camera) was not enough to fix the controller material issue. But I think this method actually looks better than the quad, because it seems to fix slight shadows on the fader when you move your view around. Disabling the UI image after the fader transitions did fix the controller material issue.
I'm having a problem where if you call the FadeIn in another script it'll reach 50% opacity but then flicker and reset to 100% opacity, the fade in plane is not too close to camera! I see someone else a few months ago was having the same problem :(
Great video, thank you. How can I activate the transition manager script when entering a collider? I would like to use this to load the next scene when the player reaches the end of the level just by reaching an end zone/collider.
Managed to figure it out. Simple cube for the restart zone, disabled the mesh rendered and added a triggered collider and rigidbody. Then just add a XR simple intractable and drop the Transition manager on one of the entered events.
would you mind if I ask a question? I can not public FadeScreen fadeScreen; it seems like if I just define this I got a error" The type or namespace name 'fadeScreen' could not be found".How can I make it work?
Hello, amazing video. How can I make it that instead of when they click the button, it is when they touch an item that they get automatically transported?
you can use the OnTriggerEnter in another script that can detect whether the user have toch the object or not. the use the method inside OnTriggerEnter to use in the logic valem explained for scene transition.
Hi Valem and everyone here, I got my view blinking after adding the Fader Screen and my ray interactor line no longer active. Can you help explain what's the problem?
im going to guess how you do it before I watch. you change the alpha of a plane in front of the camera and switch scenes when its opaque then fade it back to transparent.
For anyone having the same problem as I had, I believe that it is bcs of a newer version of Unity or maybe the material itself, but if you try the fadeIn action and can't try changing the name of the material you are calling from "_Color" to "_BaseColor"
Yeooo that works! Thanks bro
You're a genius! Thank you!!
This comment should be pinned
Great!
What
Exactly what I needed when I needed it, suggestion, I used post processing volumes for my fading instead of a quad, and it's much nicer because you can add stuff like zoom and bloom
Nice one! How can it be done? Because this way I get my grab and teleportation rays too buggy
Yes, thank you so much! You have no idea how long I have been thinking about this. Can't wait to try this out in my game this weekend.
Nice let me know how it works ! :D
Hey, can you help? I want to make it an on collision script so that whenever I touch it the scene changes
You should really make an announcement video on main, as a long time viewer (and patreon sub, though I hadn't checked in a while) I had no idea this channel existed! Great video as always :)
Thats a good point Casey thank you ! I'll make a new video announcing the new channel soon
Thank you so very much for these tutorials. They are extremely helpful and still work a year later!
Merry Christmas, thanks for the great tutorial!
Merry Christmas!
Thanks for the video. Note one thing this makes the controller rays dissapear (laser pointers). Possibly best way is to disable the fader quad all together and then enable it only when required. I believe the XR rig its fighting/blocking the laser pointer rendering. I think its becasue the shader you provided does not compensate for the render queue but my knowledge is limited on shaders. This is on Standard Render Pipeline. I did try scaling the quad to .1 and changing material render queue to no avail.
Thanks. I have been looking for a way to fade XR scenes for a while. This seems to be the answer. Fade out works great but, for some reason, fade in happens in a flash no matter what duration I set.
This happens to me too, fade in keeps flashing :(
Thanks for the detailed tutorial, learnt a lot!
dude i searched your channel for 20 minutes, just to show someone how fucking beautiful Belgian accent is
Hello (on va parler en anglais vue que c'est la langue de cette chaine 😅). The second method is THE approach to deal with if you have a big scene yes! Thx for the video you have made big progress since the begining of your videos
Thank you for the tutorial and especially for the very didactic approach
Merry Christmas! Great tutorial as always. Fade mechanism is very useful in VR. I am currently trying to prevent user from looking through the walls. Not sure how to do it, but I'll probably need to use some kind of collider attached to user's camera. The fading mechanism will also be usefull, I can block user's vision when he tries to pass through the wall :D
I was thinking the same thing. Whats to stop the player from cutting through other objects? I think setting the render on the fade object really high would work. Did you find a solution?
Good one. I'll use some of this for the next Cactus Cowboy VR game. It's much less complex than the spaghetti code I did for my fader.
Note for others; You also use this quite easily as a damage vignette / indicator.
CACTUS I NEED YOUR TIPS ON HOW TO MAKE AN INDE GAME AS GREAT AS YOURS
The FaderScreen seems to not only block ray interactors, but also the UI canvas. As a quick fix for this, I modified the SceneTransitionManager to set the FadeScreen GameObject to be active only during the fade, and inactive otherwise:
public class SceneTransitionManager : MonoBehaviour
{
public FadeScreen fadeScreen;
private void Start()
{
StartScene();
}
private void StartScene()
{
StartCoroutine(StartSceneRoutine());
}
private IEnumerator StartSceneRoutine()
{
fadeScreen.gameObject.SetActive(true);
fadeScreen.FadeIn();
yield return new WaitForSeconds(fadeScreen.fadeDuration);
// set FadeScreen to inactive, to prevent blocking ray interactors and UI canvas
fadeScreen.gameObject.SetActive(false);
}
public void GoToScene(int sceneIndex)
{
StartCoroutine(GoToSceneRoutine(sceneIndex));
}
private IEnumerator GoToSceneRoutine(int sceneIndex)
{
fadeScreen.gameObject.SetActive(true);
fadeScreen.FadeOut();
yield return new WaitForSeconds(fadeScreen.fadeDuration);
SceneManager.LoadScene(sceneIndex);
}
}
Thanks @benemy9
You are brilliant. Thanks so much!
Can u please make a video on that topic but with a loading screen in it.
Nice tutorial !
You are already making me work on holidays! Painful but great! :-)
Great tutorial! Thank you.
Great video! Would love to see a save and load function that works in VR, having a hard time understanding how to save and load position and rotation or even variables when transitioning scenes instead of having to restart the whole scene.
I'm a big fan of yours I always wanted to have a vr glasses to play but I don't have a stove how to make a homemade game for glasses made of cardboard
Awesome video! How do you keep the headset on while its off your head? Would be very useful while working!
always thank you
@ValemTutorials thank you this is great. I have implemented this method in my VR game, the fade in and and out works great. The Async of the scene is not working. I still get a little freeze hang time after one scene fades out and before the fade in on the next scene starts. Do you think you could help me to understand why? I get no errors so I am not sure what's going on. But it seems that there is no Async loading while the fade out is happening. The Async method is exactly has you done it in the video - and is implemented correctly in the UI buttons. Thank you
Thank you so much!
It's messing with my ray interactor help
Fantastic! Great video, very helpful, thank you🤟
Hi bro, nice work, why doesn't Visual Studio recognize the 'Color' and 'Renderer' parameters, what library or resource do I need to have installed for it to work? I'm trying to develop something in VR and I have installed everything I need in theory, but I don't know what happen.
same here mate
I am using OVR Rig and Ray Interactor SDK for UI when i created Screen Fader by following you, the ray interactor is not accessing UI elements, How can i fix this problem.
Any idea of how to just make the scene black for a specific duration? I tried with nested while loops and three alphas, didn't work....
after fading you can wait a bit before un fading by doing : yield return new WaitForSeconds (
and give it the number of second you want to wait
wow great tut.
hi i am totally beginner,i am looking for that but i need to do that from beginning how to put cube button scene .is it a one video or its has other series as well
What about when the scene is not empty and the game chuggs even with this solution? How would you control or prevent player from fading too soon, due to awake and start functions? We have tried delaying the fade out a few seconds after and it would still chugg.
the button is not clickable in VR, how can we solve this problem
Thaks for your help
Was trying to do this for a few days. Thanks. The FadeIn() was going a little fast for me so I added this code to update and added a public float. This adds a time the screen is all black before transition. Took off FadeIn() on Start.
public float timerFadeIn = 2f;
void Update()
{
StartFadeIn();
}
void StartFadeIn()
{
timerFadeIn -= Time.deltaTime;
if (fadeOnStart && timerFadeIn
Any idea as too why my Ui elements show through the quad? (text and images can been seen through the quad when the renderer is set to 1?)
Not too bad as it me made look into fading my Ui which has give me more control over the looks of my game.
Hello Valem, awesome tutorial as always. Even though the scene loading is done asynchronously, there is usually still the default hourglass icon from oculus appearing and the music still freezes on the transition. How could this be resolved?
Thank you so much for the tutorial!!
I would like to ask how to make the Box Collider with a trigger to work with this Scene Transition Manager script?
I want to create that a character touches a portal and transits to another scene.
it would be great to add an additional tutorial about scene change with different interactions involved!
millions thanks again!!
Create a box collider, set it to is trigger = true, create a script attached to the box collider with OnTriggerEnter,
And if the collider entering the box collider is the one on the hand of the player you can simply call the GoToScene function to transition to a new scen. :)
@@ValemTutorials thank you so much for your reply! I figured it out finally!
Great Tutorial! Is there any possibility to keep the XR interactor Line Visual?
Hi I am facing an issue with this fader screen
my UI rays don't appear while this fader layer is on but teleportation ray works. any idea why this must be happening ?
I have the same issue. Would love a solution.
@@TkMe2Mrz Possibly best way is to disable the fader quad all together and then enable it only when required. I believe the XR rig its fighting/blocking the laser pointer rendering. I think its beacsue the sahder provided does not compensate for the render queue but my knowledge is limited on shaders.
Hey great tutorial! Is there a way to prevent really bad lag and stuttering when the quad is infront of the camera? The fade works great but as soon as the quad has faded out looking around my scene becomes incredibly jarring. Any help would be greatly appreciated. Thanks
Thats weird that it makes your game lag :o maybe try to disable the quad completely after the fading?
@@ValemTutorials Thank you for your response! I'll try that. What would the easiest way to implement it be do you reckon? As i'd need to have it reactivated for when the user would want to switch back to the original scene. Thank you again for your repsonse
Thanks for the tutorial bud! its amazing. by the way, is there any way to fix the controller material? if I change it to different material, it will not change the valid and invalid color gradient anymore. Like in your video, it will always stay black line
I am currently facing this as well :/
@@luiginicastro1101 i changed my method. instead of using quad, i use world space canvas with image just for this fading transition
@@elenix4082 Interesting. I just changed my script so that when my Fade is done, the Fader gameobject turns off which shows my raycast and when I go to load a level it turns it back on which keeps everything working. I think I like your solution more haha
@@luiginicastro1101 your method is good too. Looks like we programmer can survive this problem challenge in different way x'D
@@elenix4082 @Luigi Nicastro Thank you for saying this! We are using BOTH of these fixes. Changing the quad to a world space UI canvas and UI image (attached to the Main Camera) was not enough to fix the controller material issue. But I think this method actually looks better than the quad, because it seems to fix slight shadows on the fader when you move your view around. Disabling the UI image after the fader transitions did fix the controller material issue.
any help on how to fade in to one scene, wait 30 seconds, then fade to the next???
I'm having a problem where if you call the FadeIn in another script it'll reach 50% opacity but then flicker and reset to 100% opacity, the fade in plane is not too close to camera! I see someone else a few months ago was having the same problem :(
Great video, thank you. How can I activate the transition manager script when entering a collider?
I would like to use this to load the next scene when the player reaches the end of the level just by reaching an end zone/collider.
Managed to figure it out.
Simple cube for the restart zone, disabled the mesh rendered and added a triggered collider and rigidbody. Then just add a XR simple intractable and drop the Transition manager on one of the entered events.
would you mind if I ask a question? I can not public FadeScreen fadeScreen; it seems like if I just define this I got a error" The type or namespace name 'fadeScreen' could not be found".How can I make it work?
The public FadeScreen is the name of the first script he made. Check if you made the current name.
Hello, amazing video. How can I make it that instead of when they click the button, it is when they touch an item that they get automatically transported?
you can use the OnTriggerEnter in another script that can detect whether the user have toch the object or not. the use the method inside OnTriggerEnter to use in the logic valem explained for scene transition.
Hi Valem and everyone here, I got my view blinking after adding the Fader Screen and my ray interactor line no longer active. Can you help explain what's the problem?
Your fader screen is probably to close to your camera for the blinking. Maybe you kept on the mesh collider blocking ray interactor line.
Awesome thanks alot! But when i change the scenes, the loaded one gets laggy any idea how to fix it? before used to run smoothly
Nvm it runs smoothly when its build into the oculus. Only on the editor it gets laggy
oh shit, this is good
im going to guess how you do it before I watch. you change the alpha of a plane in front of the camera and switch scenes when its opaque then fade it back to transparent.
Good guess! :]
@@ValemTutorials its how I would have done it
make a tutorial on how to make a game for cardboard vr glasses
u can't the cardboard glasses dont have any way to detect inputs and other stuff, they are just a phone in cardboard
bak