Forum Discussion
Nickdreamdev
9 years agoExplorer
OVR screen fade Does Not fade out.
I need help fading out the camera/ screen in VR to a color.
I Have tried adding this Code from another forum post from a while a go and it still does not work, I have Also tried using other Screen fading scripts, They work in the game - view in unity, but not in VR.
I Have tried adding this Code from another forum post from a while a go and it still does not work, I have Also tried using other Screen fading scripts, They work in the game - view in unity, but not in VR.
IEnumerator FadeOut() {
float elapsedTime = 0.0f;
Color color = fadeColor;
color.a = 0f;
fadeMaterial.color = color;
isFading = true;
while (elapsedTime < fadeTime)
{
yield return fadeInstruction;
elapsedTime += Time.deltaTime;
color.a = Mathf.Clamp01(elapsedTime / fadeTime);
fadeMaterial.color = color;
}
isFading = false;
}7 Replies
- GEMISISAdventurerWe're using a custom version of the fade script that handles fading in and out, as well as callbacks for when fading is completed. You'll need the Oculus included "Unlit Transparent Color" shader, but other than that it should be okay to use. If there's an issue from any Oculus staff with me sharing this script, just let me know and I'll take it down, but otherwise you can feel free to use it from here. Our code is basically the same as yours, so I'm not entirely sure why it wouldn't be working off the top of my head, so maybe give this a try to see if it fixes your issue.
- NickdreamdevExplorer
GEMISIS said:
We're using a custom version of the fade script that handles fading in and out, as well as callbacks for when fading is completed. You'll need the Oculus included "Unlit Transparent Color" shader, but other than that it should be okay to use. If there's an issue from any Oculus staff with me sharing this script, just let me know and I'll take it down, but otherwise you can feel free to use it from here. Our code is basically the same as yours, so I'm not entirely sure why it wouldn't be working off the top of my head, so maybe give this a try to see if it fixes your issue.
Thanks for this, I will try it tomorrow and tell you how it goes! :smiley: - SixerMemberHi Gemisis, which object should this script live on?
- GEMISISAdventurerThis should live on your player's face (in our case, the Unity camera in the scene). This is because it is essentially rendering a quad in front of the users face, with transparency enabled on it.
- huiyun_chenHonored GuestIt looks like this now in the unity. Anyone can help me? I have been work on this issue for many days, I AM SO TIRED OF IT.
- huiyun_chenHonored Guest
huiyun.chen said:
It looks like this now in the unity. Anyone can help me? I have been work on this issue for many days, I AM SO TIRED OF IT.Also, the controller cannot work. I can't walk or run or climb in unity with playercontroller. All it can do is show himself.
- BranojHonored Guest
Were you able to fix it ? I am facing exact same issue.. THanks
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 3 months ago
- 7 months ago
- 2 months ago