[Unity VR Development] Combined with VRTK4.0: camera collision becomes black

Quotations:

       People have to grow up, and one day you will be walking happily on the street pushing a stroller, and the love you once had, no matter what it was, will turn into wind and disappear in the tunnel of time. So go forward, go forward, without looking back.


Foreword:

          Often when we run the scene, the camera will penetrate the model. In order to avoid this situation, we need the Visuals.CollisionFader module to fade the main camera view when the user's head-mounted display device collides with other geometry in the Unity scene.


text:

         step one:

          First we need to add the corresponding module Visuals.CollisionFader :

Tilia -> Prefabs -> Visuals -> Visuals.CollisionFader

 Then we need to specify  the properties of the corresponding module in Visuals.CollisionFader  :

       After the setting is complete, run the scene and find that as long as the headset enters the Collider, the viewing angle will turn black, but what we want is that the screen will turn black only when it encounters an object that is not related to us, then we will It needs to be restricted.

       Step two:

        We first create an empty object object, and then add components to the empty object object: List Contains Rule:

         Step three:

          Let's create an empty object under the above empty object as its child object, and then add components to it: Unity Object Observable List:

 Then we drag and drop the child object into the properties of the parent object:

At this time, just drag and drop the object we specified below, which also means that only the object we specified can interact with the headset.

 Then we assign the parent object to the properties of Visuals.CollisionFader  :

 extension:

At the beginning, we only add the specified object on the parent object to interact with the headset. Sometimes the scene is too large and not suitable. At this time, we can use another method to specify the corresponding tag (Tag): AnyTagRule:

 Then we add the corresponding label, and replace the object label that needs to be interacted with with the label we set.


Guess you like

Origin blog.csdn.net/LiKe11807/article/details/130259946