# Error when using teleporter device or movement modulator device in Verse.

**URL:** <https://forums.unrealengine.com/t/error-when-using-teleporter-device-or-movement-modulator-device-in-verse/1881960>\
**Category:** Issues and Bug Reporting\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, bug-report, fortnite\
**Created:** [May 31, 2024, 5:47am UTC](https://forums.unrealengine.com/t/error-when-using-teleporter-device-or-movement-modulator-device-in-verse/1881960 "2024-05-31T05:47:46Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Jimbohalo10](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jimbohalo10/32/961440_2.png) [@Jimbohalo10](https://forums.unrealengine.com/u/Jimbohalo10)\
**Post date:** [May 31, 2024, 10:11pm UTC](https://forums.unrealengine.com/t/error-when-using-teleporter-device-or-movement-modulator-device-in-verse/1881960/6 "2024-05-31T22:11:33Z")

</div>

Hi @Yamabuki_Iro ,

Well @Yamabuki_Iro @Punkcat ,  
Wont allow me a new post so Replacing this one with  
from Code Snippets [Dynamic Player Teleporter Device](https://dev.epicgames.com/community/snippets/1WAo/fortnite-dynamic-player-teleporter-device)  
This has been changed to effectively adding failure recovery and when a failure occurs it retries.

The teleport function is possibly broken, this attempts to program verse code to stop runtime errors

```auto
using { /Fortnite.com/Devices }

using { /Verse.org/Simulation }

using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }

# To use this device, create a prop and attach a teleporter device to it. Ensure the teleport device
# has zero local position and rotation. Assign the prop and teleporter device to the editable
# properties and then call `TeleportAgentTo`.

dynamic_player_teleporter_device_log := class(log_channel){}

dynamic_player_teleporter_device := class(creative_device):

    Logger : log = log{Channel:=dynamic_player_teleporter_device_log}

    @editable
    TeleporterDevice: teleporter_device = teleporter_device{}

    @editable
    TeleporterRoot: creative_prop = creative_prop{}

    # Teleports an agent to a given translation and rotation. Note, only the yaw axis is used
    # on rotation by setting the teleporter rotation (if you configure your teleporter to use set player rotation)
    TeleportAgentTo(Agent: agent, Translation: vector3, Rotation: rotation):void =

        if(TeleporterRoot.TeleportTo[Translation, Rotation]):

            Logger.Print("Teleporting agent to {Translation}", ?Level:=log_level.Verbose) 

            # the attempt have worked now call the real TeleporterDevice will not cause runtime error

            TeleporterDevice.Teleport(Agent)

        else. Logger.Print("Failed to move dynamic teleporter prop!", ?Level:=log_level.Error)
              # Try for the second time as it may be transient
               if(TeleporterRoot.TeleportTo[Translation, Rotation]):

                     Logger.Print("Worked on second attempt Teleporting agent to {Translation}", ?Level:=log_level.Verbose)

                       TeleporterDevice.Teleport(Agent)

               else. Logger.Print("Final attempt dynamic teleporter prop!", ?Level:=log_level.Error)
               # This second else will stop a runtime error stopping Verse crashing

```

There may be typing and format errors, but the reason is to show the logic of stopping a runtime error then reporting the error and retrying

---

_[View the full topic](https://forums.unrealengine.com/t/error-when-using-teleporter-device-or-movement-modulator-device-in-verse/1881960)._
