Skip to main content
PaidFareZoneRanger
Up and Coming
March 11, 2025
Solved

Easily teleport from one spot to another

I attempted to use the AI, but it just gave me code that Visual Studio Code doesn't like. What's the ingredients/code where if you hit a spot, you get teleported to another spot. 

 

I'm having difficulties with this. 

PigeonNo12
Honored Contributor
March 11, 2025

This is a very simple implementation:

1) Add a trigger gizmo to the world

2) Add a script to the world, with the code specified above

3) Attach the script to the gizmo

4) Add a Spawn Point gizmo, and connect it to the properties of the trigger

If everything is connected, the player will get teleported to the Spawn Point location when they enter the trigger. 

Note that the trigger is invisible in preview mode, so you might want to add some geometry around it, so the players know where to go, unless your intention is to keep it hidden.

 

Upcoming Events : Build with a Mentor: Custom UI Thursday 3/20 at 5:00 PM PT Register March calendar of all Mentor Workshops and Office Hours

6 replies

PigeonNo12
Honored Contributor
March 11, 2025

This is a very simple implementation:

1) Add a trigger gizmo to the world

2) Add a script to the world, with the code specified above

3) Attach the script to the gizmo

4) Add a Spawn Point gizmo, and connect it to the properties of the trigger

If everything is connected, the player will get teleported to the Spawn Point location when they enter the trigger. 

Note that the trigger is invisible in preview mode, so you might want to add some geometry around it, so the players know where to go, unless your intention is to keep it hidden.

 

Upcoming Events : Build with a Mentor: Custom UI Thursday 3/20 at 5:00 PM PT Register March calendar of all Mentor Workshops and Office Hours
PaidFareZoneRanger
Up and Coming
March 11, 2025

I'm almost there.

However, here's where I'm stuck:

 

It's not liking my import statement. 

PigeonNo12
Honored Contributor
March 11, 2025

Did you create and opened the script through the Desktop Editor? If not, that could be the issue here because horizon/core is not being recognized, causing all the errors that you see.

Upcoming Events : Build with a Mentor: Custom UI Thursday 3/20 at 5:00 PM PT Register March calendar of all Mentor Workshops and Office Hours
PaidFareZoneRanger
Up and Coming
March 11, 2025

Correct. I am going thru the desktop editor. I'm having flashbacks to compilation errors when I worked with Cypress.io

PaidFareZoneRanger
Up and Coming
March 13, 2025

In this morning's build(today is 3/13), I was able to get teleporting to work. The reminder to myself is to turn the "world sim on", just before you do a quick "preview from here" test. 

Now I can make safety "fall through" nets.

 

gausroth
Honored Contributor
March 14, 2025

If you click on the three-dot button next to the play and stop buttons, you can toggle simulation on/off when you enter/exit preview mode.

GitHub: https://github.com/Gausroth/HorizonWorldsTutorials.git Discord: https://discord.gg/hNyDQwdw4N YouTube: https://www.youtube.com/@GausRothTutorials