ExtendRealityLtd / VRTK

An example of how to use the Tilia packages to create great content with VRTK v4.
https://www.vrtk.io/
MIT License
3.69k stars 993 forks source link

Objects being destroyed while touching the camera will cause a permanent black screen. #598

Closed 01271 closed 8 years ago

01271 commented 8 years ago

Hello, the issue here is that if I have enemies who fire rockets, balls or items at the player's head and the items are set to be destroyed upon collision, the onTriggerExit in VRTK_HeadsetCollisionFade.cs event will not be called.

This results in the screen becoming permanently black (my current fade colour).

I have made a simple and cheap solution: move the items to Vector3.zero then delete them, but I thought it would be a good addition to VRTK itself to have "black-screen due to objects being deleted in-camera" prevention built in, as it could occur in random or unpredictable instances (such as a player having their head accidentally in a prop they shouldn't be in that's about to be destroyed).

Issue replication: have the camera touch anything that would cause it to have a black screen, then destroy the object it is touching.

thestonefox commented 8 years ago

I would have thought the OnTriggerExit would have been called when the object was destroyed. I'll look into it and see what's going on.

thestonefox commented 8 years ago

Fixed with https://github.com/thestonefox/SteamVR_Unity_Toolkit/commit/49bc483cb1b75efe436cc60d54c1c6f4c694cc1a

Sorry for the delay