Custom Kill animation

I want a VFX to happen when a player dies similar to this: https://x.com/UEFN_hub/status/1730429012462473723?s=20

I already set up the vfx niagara in uefn and wrote this code, but i don’t understand why it doesn’t work. I would appreciate some help!

using { /Fortnite.com/Game }
using { /Fortnite.com/Characters }
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }


KillVFX := class(creative_device):
    
    @editable
    EliminationManager : elimination_manager_device = elimination_manager_device{}

    @editable
    KillVFXDevice : vfx_spawner_device = vfx_spawner_device{}

    OnBegin<override>()<suspends>:void=
        GetPlayspace().PlayerAddedEvent().Subscribe(SetupPlayer)
        AllPlayers := GetPlayspace().GetPlayers()
            for (Player : AllPlayers):
                SetupPlayer(Player)

    OnPlayerEliminated(Result : elimination_result):void=
        EliminatedCharacter := Result.EliminatedCharacter
        if:
            EliminatedFortCharacter := EliminatedCharacter
            EliminatedAgent := EliminatedFortCharacter.GetAgent[]
        then:
            spawn:
                MoveIceBlock(EliminatedCharacter)

    SetupPlayer(Agent: agent): void =
        if (FortCharacter := Agent.GetFortCharacter[]):
            FortCharacter.EliminatedEvent().Subscribe(OnPlayerEliminated)
        
    MoveIceBlock(EliminatedCharacter:fort_character)<suspends>:void=
        KillVFXDevice.MoveTo(EliminatedCharacter.GetTransform().Translation - vector3{Z:= 80.0}, EliminatedCharacter.GetTransform().Rotation, 0.1)
        spawn:
            StartKillEffect()

    StartKillEffect()<suspends>:void=
        KillVFXDevice.Enable()
        Sleep(3.0)
        KillVFXDevice.Disable()
        
2 Likes

Did you manage to make it works i kinda want to make a simular thing ?

I am basically doing a power that move a premade vfx to the fort_character position and is being enabled for 10 seconds but it does not teleport and even activate there is the code :

    using { /Fortnite.com/Devices }
    using { /Verse.org/Simulation }
    using { /UnrealEngine.com/Temporary/Diagnostics }
    using { /Fortnite.com/Characters }
    using { /UnrealEngine.com/Temporary/SpatialMath }

    powers := class(creative_device):
        
        @editable SignalRemoteGrey : signal_remote_manager_device = signal_remote_manager_device{}
        @editable VFXDevice : vfx_spawner_device = vfx_spawner_device{}
        
        
        HandlePrimaryButton( P : agent) : void =
              spawn:
                    StartEffect(P)
                
               

        StartEffect(P: agent)<suspends> : void =
            if (F := P.GetFortCharacter[]):
                if (VFXDevice.TeleportTo[F.GetTransform().Translation, F.GetTransform().Rotation]):
                    VFXDevice.Enable
                    spawn:
                        EndEffect()
                        
        EndEffect()<suspends> : void = 
            Sleep(10.0)
            VFXDevice.Disable 
 
            
            
        HandleSecondaryButton( P : agent) : void =
            if (f := P.GetFortCharacter[]):
    

        OnBegin<override>()<suspends>:void=
                SignalRemoteGrey.PrimarySignalEvent.Subscribe(HandlePrimaryButton)
                SignalRemoteGrey.SecondarySignalEvent.Subscribe(HandleSecondaryButton)

Would apreciate some help im very new to verse and uefn.

Try adding some logging to your code. you can use the print function to get feed back in game

eg. Print("My Function Executed")

then you can see what works or how far your code is working

you can access the log whilst in game from your island menu

1 Like

Thanks i’ll try that out and let you updated

get any fixes?