Touch Teleport | Teleports the Camera's origin to the Position of the affected object. |
The Touch Teleport Node works similar to the Touch Button Node as it is an object-based Interaction Node as well. It is mainly aimed to be used in Virtual Reality Use Cases.
The Touch Teleport node is derived from Touch Button and as such inherits the same properties and events to detect whether a touch is hovering inside the active area of the node or actually pressed. These can for example be used to add some custom visual feedback when the user activates the teleport node.
As an Interaction Node the Touch Teleport node is not bound to be used with VR Controllers only. You can trigger its Touch Behavior with any Touch Input - e.g. a Touch Screen or Windows Mouse.
Due to its object-based behavior it has to be placed in front of Objects in your scene that you want to act as a walkable ground. Whenever a Single Tap Event is processed on that Object it will teleport the current Layer's Camera to the position of the Touch Teleport Node. This Teleport will preserve the current Offset of the Camera to the World's origin and apply it to the new Position - this is illustrated in the schematic below.
There are two modes in which you can use the Touch Teleport Node. It can be changed with the RayIntersection property. When turned on, the new position will be at the exact point where the Touch Ray intersected with the Object. When turned off, the new position will be determined by the current World Matrix of the Touch Teleport node. This means that Axis Nodes do not affect the new position when placed behind the Teleport Node.
Once the Camera has been teleported to the Touch Teleport Node its Position and Rotation also affects the Camera. This way you can let your user teleport himself onto moving platforms.
Note that only the Translation to the new Position will be applied during a Teleport. The Rotation of the target Objects are not taken into account at the moment of teleportation.
The Teleport Method allows for manual triggering of the Teleport. Regardless of the used RayIntersection it will teleport to the Position of the Touch Teleport. The Teleported Event is fired as soon as either a Touch Input or the Teleport Method has triggered a teleport.