Restricting Teleportations
In VR projects, sometimes we use teleporting to move around, especially in large scenes.
You can teleport to an object if its Intersection mask matches the Teleportation mask in the settings of the vr_player_spawner.prop property. By default, the second bit of the Teleportation mask is used. So, you can teleport to objects for which the Intersection option is enabled, and the second bit of the Intersection mask is set.
To restrict teleportation to a certain area, do the following:
- Create a new Static Mesh object by using the default plane (core/meshes/plane.mesh) or an arbitrary mesh that will define the restricted area.
- Place the Static Mesh in the scene just above the floor.
-
Go to the Parameters window and make sure that the second bit of the Intersection mask is disabled.
-
Save and run the application. Now, you cannot teleport to the area defined by the rectangular plane (the ray and the target point are red).
-
To hide the Static Mesh, disable all bits of its Viewport and Shadow masks.
-
Save changes and run the application: the rectangular plane is invisible now.