How to use 'Dungeon Portals' to have portals/teleportation within your game

This tutorial will be using the Dungeon Portals - Single package to create a Portal using a basic example Portal template!

Navigate to the template library, and double click on ‘portalBase’

image

Next, click on the portalBase locator entity, and scroll down to portalScript.

Many of these properties already have values entered as it’s a starting template.

Read more about the properties and what each one does

First, we have the Portal config…

Trigger: The trigger is what detects the player, and is used to teleport them.
Respawn Time: You can set a certain amount of time for the portal to ‘respawn’ after it has been entered/used by a player. This can be set to 0 if you wish to have the portal respawn instantly.
Active Effect: The effect the portal will show when it is available for use. For example, if you are using a respawn time, then while the portal is respawning, this active effect will not be shown.
Using Sound: The sound that is played while a portal is actively being used (such as a ground portal with a delayed teleport) or when portal has been entered.
Used Effect: The effect that is played when the portal has been used.
Used Effect Lifetime: Some effects may loop endlessly, or last too long. The lifetime value entered here will stop the used effect after a certain amount of seconds.

The Portal config also includes optional settings:

Allow Interact: If true, the player will be able to press the interact keybind to teleport, rather then walking through the trigger.
Prompt Msg: The message to show the player if you have the ‘Prompts’ package installed.
Use Light: A light to brighten the portal when active, or dim when inactive (while it’s respawning)
Using Effect: Similar to the ‘Used’ effect, the Using effect is an effect to show while the portal is actively being used (such as a ground portal with a delayed teleport)
Inactive Effect: Where the ‘Active’ effect shows when the portal is available for use, the Inactive effect will show while the portal is not available/is respawning.

Lastly, we have the Teleport config:

Arrival Effect: This effect will essentially be played on the player when they have arrived at the ‘teleportLocation’
Sound: The sound to play upon arrival to the ‘teleportLocation’
Location: The ‘teleportLocation’ locator. This can be placed anywhere inside of your game world. Wherever it is placed, is where the player will be teleported to after using the portal.
Enable Delay: This setting is optional, if used, it means that the player will have to stand within the portal for some time before they are teleported. This is great for ground portals, but probably not so great for regular standing portals.
On Teleport Complete: Events to send whenever the teleport has been completed.

Using the default values of the example template, this is what the Portal looks like, and also an example of the ‘Active’ effect:

Since the portal was used, it will show the ‘Used’ effect, and the ‘Arrival’ effect, which is currently set to use the same effect:

Because it has a respawn time, it will show the ‘Inactive’ effect while it is respawning:

Any mesh can be added to the portal, but in this case, let’s attach the ‘Magical Portal - Stone Gate’ mesh:

Next, I’m going to switch up some of the effects on the ‘portalBase’ locator entity (Active, Used, and Arrival)…

As you can see, the Active effect (and probably the Inactive effect too) is a bit low on the portal. There is a simple solution to this, which involves moving the effect locators upwards. Wherever these locators are, is where that specific effect will be played in the world.

In this case, let’s try moving upwards by two voxels.

Here is the result, much better:

Anyways, from here I would recommend experimenting with different meshes and effects to create truly unique portals for your games.