This document is slightly outdated. FIXME: Mentions welcome domain, welcome domain url malformed, mentions GoTo app
Tutorial: Create a Portal
Portals in Vircadia transport you to the domain of your choice. You can use these portals to travel to a domain you visit frequently instead of using the GoTo app on your HUD or Tablet.
On This Page:
Consider getting familiar with the following concepts before starting this tutorial:
Write a Script for the Portal
A portal is an entity with a script attached (entity script). This attached script defines what happens when a user comes in contact with the portal. We've used portal.js, the script used to teleport in Vircadia domains. You can also write your own script to suit your needs.
The portal.js script we've used:
Includes a sound that will played every time a user uses the portal.
Teleports a user to the specified destination.
Create and Edit an Entity to Use as a Portal
Any entity you create to be used as a portal has to be collisionless so that the script can detect when you walk into the entity.
In Interface, pull up your HUD or Tablet and go to Create.
Create an entity to be used as a portal. This can be a 3D model or a box or sphere entity.
Go to the 'Properties' tab and scroll down to 'Behavior'.
Next to 'Script', paste the script URL. In this case, it is 'portal.js'.
The script takes the location you want to teleport to from the 'User Data' field under 'Behavior'.
hifi:// welcome(Vircadia's welcome domain) to the 'User Data' field.
Scroll down to 'Collision' and uncheck 'Collides'. This is so that a user can walk into the entity and trigger the script.
Exit Create mode and walk into the entity.
You will be teleported to Vircadia's welcome domain.