This invocation calls a function that has the 'decides' effect, which is not allowed

using { /Fortnite.com/Devices }
using { /Fortnite.com/Game}
using { /Fortnite.com/Characters}

using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

See Create Your Own Device Using Verse for how to create a verse device.

A Verse-authored creative device that can be placed in a level

fireball_player := class(creative_device):

@editable var VFXSpawner : vfx_spawner_device = vfx_spawner_device{}
@editable var DamageDevice : damage_volume_device = damage_volume_device{}
@editable var DeviceMover : creative_prop = creative_prop{}
@editable var FireballConditional : conditional_button_device = conditional_button_device{}
@editable var FireballTrigger : trigger_device = trigger_device{}


OnFireballActivated(Agent : agent):void=

        spawn:
            OnFireball(Agent)       


OnFireball(Agent: agent)<suspends>:void=

    if (f := Agent.GetFortCharacter[]):
        Transform := f.GetTransform()
        DeviceMover.TeleportTo[Transform.Translation, Transform.Rotation]
        Sleep(0.1)
        VFXSpawner.Enable()
        DamageDevice.Enable()
        DeviceMover.MoveTo(f.GetTransform().Translation, f.GetTransform().Rotation, 3.0)
        DamageDevice.Disable()
        VFXSpawner.Disable()


OnBegin<override>()<suspends>:void=
    FireballConditional.ActivatedEvent.Subscribe(OnFireballActivated)

it’s “DeviceMover.TeleportTo[Transform.Translation, Transform.Rotation]” that is causing it, I have no idea, help im stupid lol

Your function " OnFireball(Agent: agent):void= " has the Suspend Effect which means the function is async, and it creates an async context for the body of the function. Teleport to only works in functions that has the Decides Effect and Transacts Effect also when you call the function you must call it in a failable expression.

1 Like