Teleporting

'Teleporting' is a way to move the user to a new location. You can use teleporting to set an initial location for the user to start off in the world; to create a portal or warp that moves you to a new location in response to an event; or to help with structuring large worlds.

This is all done with the teleport message, which is part of the user node. Recall that this node is usually in a user scene file in the users/ directory, such as User0.scene. Open that file up, and add the fly() and teleport() messages as below. Include this user in a scene file and run it. You should appear 40 feet above the ground. If your scene file has a ground object with floor(true), you'll fall down to the ground.

user User0 () { caveNavigator navigatorUser0 (fly(false),teleport(0 0 40)) caveHead headUser0 () caveTracker wandTrackerUser0 (sensor(1)) { caveWand wandUser0 () { } } }

(c) Ben Chang