[Unity VR development] Combine VRTK4.0: add object follower

Quotations:

       I have prepared enough umbrellas to keep out the rain, but I have not waited for the rain to come. This kind of embarrassment is just a small episode in my long life.


Foreword:

        The purpose of an object follower is to have one or more game objects follow another object in the scene without nesting game objects under each other.

There are two types of followers:

Mutators.ObjectFollower : Updates the target's data to match the source's data.

Mutators.RigidbodyFollower : Updates the target by applying velocity to the target until the target data matches the source data.


text:

      step one:

       Add a Cube to be used as the source game object, and a Sphere to be used as the target object, which will follow the source game object.

      Step two:

        Add follower module: Mutators.ObjectFollower .

Tilia -> Prefabs -> Mutators -> Mutators.ObjectFollower

 

      Drag and drop the previously created game object into the corresponding property of the component:

     Play the scene, move the Cube, and the sphere will follow it in real time.

        Step three:

            We now need to create an offset so that when the sphere follows the cube, it is slightly away from the cube's position. So, we create an empty object as a child of the sphere

        Step four:

            Drag and drop an empty object into the Mutators.ObjectFollower property:

       Play:

        Running the scene, the sphere now still follows the cube, but the sphere is offset below the cube.

          


Guess you like

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