Smooth Scene Fade Transition in VR

  Рет қаралды 38,363

Valem Tutorials

Valem Tutorials

Күн бұрын

Пікірлер: 92
@elephin
@elephin Жыл бұрын
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"
@BossKing1243
@BossKing1243 Жыл бұрын
Yeooo that works! Thanks bro
@wenli4070
@wenli4070 11 ай бұрын
You're a genius! Thank you!!
@sardarshahrukh5682
@sardarshahrukh5682 11 ай бұрын
This comment should be pinned Great!
@lucutes2936
@lucutes2936 7 ай бұрын
What
@aliasd5423
@aliasd5423 3 жыл бұрын
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
@criskywalker17
@criskywalker17 2 жыл бұрын
Nice one! How can it be done? Because this way I get my grab and teleportation rays too buggy
@benemy9
@benemy9 6 ай бұрын
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); } }
@sankgoku
@sankgoku 2 ай бұрын
Thanks @benemy9
@TheARTofMining
@TheARTofMining Жыл бұрын
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.
@drruka850
@drruka850 3 жыл бұрын
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.
@ValemTutorials
@ValemTutorials 3 жыл бұрын
Nice let me know how it works ! :D
@cedricknapp2889
@cedricknapp2889 3 жыл бұрын
Merry Christmas, thanks for the great tutorial!
@CaseyBoller
@CaseyBoller 2 жыл бұрын
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 :)
@ValemTutorials
@ValemTutorials 2 жыл бұрын
Thats a good point Casey thank you ! I'll make a new video announcing the new channel soon
@wenli4070
@wenli4070 11 ай бұрын
Thanks for the detailed tutorial, learnt a lot!
@michaorzechowski4948
@michaorzechowski4948 3 жыл бұрын
Merry Christmas!
@usernotfound6407
@usernotfound6407 Жыл бұрын
dude i searched your channel for 20 minutes, just to show someone how fucking beautiful Belgian accent is
@kooky74
@kooky74 4 ай бұрын
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
@genofelice6034
@genofelice6034 2 жыл бұрын
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.
@Andrew-lo2lk
@Andrew-lo2lk Жыл бұрын
This happens to me too, fade in keeps flashing :(
@zillieness
@zillieness 2 жыл бұрын
Thank you so very much for these tutorials. They are extremely helpful and still work a year later!
@moritzfriedrich
@moritzfriedrich Жыл бұрын
You are brilliant. Thanks so much!
@sl4927
@sl4927 2 жыл бұрын
Thank you for the tutorial and especially for the very didactic approach
@ScareFire
@ScareFire 3 жыл бұрын
Nice tutorial !
@CactusVRstudios
@CactusVRstudios 3 жыл бұрын
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.
@dantheman3825
@dantheman3825 9 ай бұрын
CACTUS I NEED YOUR TIPS ON HOW TO MAKE AN INDE GAME AS GREAT AS YOURS
@Tester13565
@Tester13565 Жыл бұрын
always thank you
@serpnta1267
@serpnta1267 3 жыл бұрын
Great tutorial! Thank you.
@ChuckiBinner
@ChuckiBinner 6 ай бұрын
Fantastic! Great video, very helpful, thank you🤟
@silwer222
@silwer222 3 жыл бұрын
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
@samsil187
@samsil187 2 жыл бұрын
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?
@ibro677
@ibro677 4 ай бұрын
Can u please make a video on that topic but with a loading screen in it.
@MsGul
@MsGul 2 жыл бұрын
Thank you so much!
3 жыл бұрын
You are already making me work on holidays! Painful but great! :-)
@davidson4101
@davidson4101 2 жыл бұрын
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
@baluuvids
@baluuvids 2 ай бұрын
Awesome video! How do you keep the headset on while its off your head? Would be very useful while working!
@TurkiKAlqou
@TurkiKAlqou 2 жыл бұрын
It's messing with my ray interactor help
@kingbrodan
@kingbrodan 2 жыл бұрын
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.
@esrivera2228
@esrivera2228 7 ай бұрын
Thaks for your help
@silentshadow89
@silentshadow89 2 жыл бұрын
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.
@billybobthe9thjr786
@billybobthe9thjr786 Жыл бұрын
same here mate
@tctopcat1981
@tctopcat1981 2 жыл бұрын
wow great tut.
@krestenkuzkuz
@krestenkuzkuz 2 жыл бұрын
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....
@ValemTutorials
@ValemTutorials 2 жыл бұрын
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
@neilfosteronly
@neilfosteronly 2 жыл бұрын
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
@REC_crazy
@REC_crazy Жыл бұрын
Hey, can you help? I want to make it an on collision script so that whenever I touch it the scene changes
@moxx
@moxx Жыл бұрын
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!!
@ValemTutorials
@ValemTutorials Жыл бұрын
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. :)
@moxx
@moxx Жыл бұрын
@@ValemTutorials thank you so much for your reply! I figured it out finally!
@frankyredente4152
@frankyredente4152 8 ай бұрын
@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
@pratyasha4849
@pratyasha4849 Жыл бұрын
the button is not clickable in VR, how can we solve this problem
@sudhakarkumar2080
@sudhakarkumar2080 5 ай бұрын
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.
@cherrycoked3
@cherrycoked3 Жыл бұрын
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?
@imanniom
@imanniom Жыл бұрын
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.
@willworkforfood9102
@willworkforfood9102 Жыл бұрын
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.
@willworkforfood9102
@willworkforfood9102 Жыл бұрын
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.
@elenix4082
@elenix4082 2 жыл бұрын
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
@luiginicastro1101
@luiginicastro1101 2 жыл бұрын
I am currently facing this as well :/
@elenix4082
@elenix4082 2 жыл бұрын
@@luiginicastro1101 i changed my method. instead of using quad, i use world space canvas with image just for this fading transition
@luiginicastro1101
@luiginicastro1101 2 жыл бұрын
@@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
@elenix4082 2 жыл бұрын
@@luiginicastro1101 your method is good too. Looks like we programmer can survive this problem challenge in different way x'D
@zillieness
@zillieness 2 жыл бұрын
@@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.
@bhanupatil6034
@bhanupatil6034 Жыл бұрын
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
@TkMe2Mrz Жыл бұрын
I have the same issue. Would love a solution.
@TheARTofMining
@TheARTofMining Жыл бұрын
@@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.
@hate7486
@hate7486 2 жыл бұрын
Great Tutorial! Is there any possibility to keep the XR interactor Line Visual?
@A_walk_in_the_park
@A_walk_in_the_park Жыл бұрын
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?
@fatamatojjohora3755
@fatamatojjohora3755 10 ай бұрын
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
@jamesprise4252
@jamesprise4252 2 жыл бұрын
any help on how to fade in to one scene, wait 30 seconds, then fade to the next???
@jackward5944
@jackward5944 Жыл бұрын
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
@ValemTutorials Жыл бұрын
Thats weird that it makes your game lag :o maybe try to disable the quad completely after the fading?
@jackward5944
@jackward5944 Жыл бұрын
@@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
@rylee5233
@rylee5233 2 жыл бұрын
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?
@neilfosteronly
@neilfosteronly 2 жыл бұрын
The public FadeScreen is the name of the first script he made. Check if you made the current name.
@fernandocgi3874
@fernandocgi3874 2 жыл бұрын
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
@fernandocgi3874
@fernandocgi3874 2 жыл бұрын
Nvm it runs smoothly when its build into the oculus. Only on the editor it gets laggy
@Andrew-lo2lk
@Andrew-lo2lk Жыл бұрын
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 :(
@johnkarl3143
@johnkarl3143 2 жыл бұрын
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.
@chikodarkzcaguaii
@chikodarkzcaguaii 3 жыл бұрын
oh shit, this is good
@endgamedevs
@endgamedevs 2 жыл бұрын
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.
@zackng9544
@zackng9544 2 жыл бұрын
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?
@neilfosteronly
@neilfosteronly 2 жыл бұрын
Your fader screen is probably to close to your camera for the blinking. Maybe you kept on the mesh collider blocking ray interactor line.
@adhochero6619
@adhochero6619 3 жыл бұрын
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.
@ValemTutorials
@ValemTutorials 3 жыл бұрын
Good guess! :]
@adhochero6619
@adhochero6619 3 жыл бұрын
@@ValemTutorials its how I would have done it
@davidson4101
@davidson4101 2 жыл бұрын
make a tutorial on how to make a game for cardboard vr glasses
@billybobthe9thjr786
@billybobthe9thjr786 Жыл бұрын
u can't the cardboard glasses dont have any way to detect inputs and other stuff, they are just a phone in cardboard
@lucutes2936
@lucutes2936 7 ай бұрын
bak
How to Make Physics Hands in VR - PART 1 - Unity VR Tutorial
13:10
Valem Tutorials
Рет қаралды 89 М.
How to make AWESOME Scene Transitions in Unity!
19:45
Brackeys
Рет қаралды 965 М.
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
Introduction to VR in Unity - PART 1 : VR SETUP
20:36
Valem
Рет қаралды 861 М.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,3 МЛН
How to Fade Between Scenes in Unity
13:28
Brackeys
Рет қаралды 346 М.
VR Optimization and Performance Tips for Unity
14:22
VR with Andrew
Рет қаралды 52 М.
Optimizing my Game so it Runs on a Potato
19:02
Blargis
Рет қаралды 681 М.
Best Graphics for VR in Unity - HDRP Tutorial
17:22
Valem Tutorials
Рет қаралды 5 М.
Watch this if you've never tried JOBS in Unity (Tutorial)
10:32
Sasquatch B Studios
Рет қаралды 12 М.
How to Make a VR Game in Unity - PART 1
14:13
Valem Tutorials
Рет қаралды 688 М.
Free VR Template to Start any Project in Unity
7:20
Valem Tutorials
Рет қаралды 41 М.
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН