# Custom Kill animation

**URL:** <https://forums.unrealengine.com/t/custom-kill-animation/1470533>\
**Category:** Verse\
**Tags:** question, fortnite\
**Created:** [December 4, 2023, 2:42pm UTC](https://forums.unrealengine.com/t/custom-kill-animation/1470533 "2023-12-04T14:42:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jan.xyz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jan.xyz](https://forums.unrealengine.com/u/jan.xyz)\
**Post date:** [December 4, 2023, 2:42pm UTC](https://forums.unrealengine.com/t/custom-kill-animation/1470533/1 "2023-12-04T14:42:55Z")

</div>

I want a VFX to happen when a player dies similar to this: [https://x.com/UEFN\_hub/status/1730429012462473723?s=20](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!

```auto
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()
        

```

---

<div class="post-metadata">

**Author:** ![motyr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@motyr](https://forums.unrealengine.com/u/motyr)\
**Post date:** [January 9, 2024, 5:50pm UTC](https://forums.unrealengine.com/t/custom-kill-animation/1470533/2 "2024-01-09T17:50:31Z")

</div>

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 :

```auto
    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.

---

<div class="post-metadata">

**Author:** ![bananna\_manuk](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@bananna\_manuk](https://forums.unrealengine.com/u/bananna_manuk)\
**Post date:** [January 9, 2024, 6:43pm UTC](https://forums.unrealengine.com/t/custom-kill-animation/1470533/3 "2024-01-09T18:43:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![motyr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@motyr](https://forums.unrealengine.com/u/motyr)\
**Post date:** [January 9, 2024, 6:50pm UTC](https://forums.unrealengine.com/t/custom-kill-animation/1470533/4 "2024-01-09T18:50:33Z")

</div>

Thanks i’ll try that out and let you updated

---

<div class="post-metadata">

**Author:** ![ItzEarthy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/itzearthy/32/764585_2.png) [@ItzEarthy](https://forums.unrealengine.com/u/ItzEarthy)\
**Post date:** [January 18, 2024, 11:47pm UTC](https://forums.unrealengine.com/t/custom-kill-animation/1470533/5 "2024-01-18T23:47:43Z")

</div>

get any fixes?
