Teleport spawn points

It is very common in VR applications to limit teleportation to only specific predefined locations within the scene. In that case, you would not need any free-roaming glide locomotion or arbitrary teleportation targets. Instead, you can define the specific teleportation spawn points. Let's see how to do this.

First, let's create a TeleportSpawn prefab to mark our locations:

  1. In Hierarchy, create a 3D Sphere and name it TeleportSpawn
  2. Reset its transform (gear icon | Reset)
  3. Set its Scale to 0.4, 0.4, 0.4
  4. Set its Position to something like (2, 0, 3)
  5. Create a new layer named TeleportSpawn from Inspector | Layers | Add Layer and fill in the name in an empty slot
  6. Select the TeleportSpawn object in Hierarchy again, and now set ...

Get Unity Virtual Reality Projects - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.