Reputation: 1
I am currently trying to fade the screen to black when the player exceed a specified y-value (when they stand up). I am using Unity for Oculus Quest 2 (And I'm a newbie).
I have tried just using a Canvas (Image), but I have trouble making it become the "foremost" overlay. How would you approach this? It would also be very nice with a fade to black effect (maybe as coroutine?)
Thank you!
I tried experimenting with the different Canvas rending modes, as I've seen people advising to use the World Space. I tried spawning in a black cube, but obviously when I'm inside the cube it does not go full black.
Upvotes: 0
Views: 471
Reputation: 579
Put a cube right at near-clipping-plane distance of the camera. The cube should be big enough to cover the whole FOV. Fade the cube's color via the material. Done:)
Note: Using a cube avoids the problem that in MR applications non-world-space UI elements do not work as intended!
Upvotes: 1