This page has been translated automatically.
Unigine Basics
1. Introduction
2. Managing Virtual Worlds
3. Preparing 3D Models
4. Materials
5. Cameras and Lighting
6. Implementing Application Logic
7. Making Cutscenes and Recording Videos
8. Preparing Your Project for Release
9. Physics
10. Optimization Basics
11. PROJECT2: First-Person Shooter
12. PROJECT3: Third-Person Cross-Country Arcade Racing Game
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Restricting Teleportations

In VR projects, sometimes we use teleporting to move around, especially in large scenes.

By default, you can teleport to any point of the scene. But sometimes, it might be necessary to restrict teleportation to certain areas (for example, to the roof). The VR Template provides the TeleportationMovement component (assigned to the vr_layer -> vr_movement_manager -> teleportation_movement node) that implements teleportation logic and allows specifying the maximum teleportation distance, the appearance of the ray and target point, and so on.

You can teleport to an object if its Physics Intersection mask matches the Teleportation mask in the component settings. By default, the second bit of the Teleportation mask is used. So, you can teleport to objects for which the Physics Intersection option is enabled, and the second bit of the Physics Intersection mask is set.

To restrict teleportation to a certain area, do the following:

  1. 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.
  2. Place the Static Mesh in the scene just above the floor.
  3. In the Parameters window, enable the Physics Intersection option for the object and check that the second bit of the Physics Intersection mask is disabled.

  4. 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).

  5. To hide the Static Mesh, disable all bits of its Viewport and Shadow masks.

  6. Save changes and run the application: the rectangular plane is invisible now.

Last update: 2024-08-16
Build: ()