What's the "Lyra" way to "insta-kill" a player with a blueprint?

I just created a Team Select menu that let’s a player change teams. Upon selection I would like the player to die so they can respawn. How can you do this?

I’ve tried ApplyingGamePlayEffectToSelf and I’ve also tried to ApplyDamage, but neither works.

Hi,
You should be able to get the reference to the character that you want to be destroyed and call the destroy node on him. After that you can get the reference to the player controller and possess the newly spawned character.

You posted the same question in two different threads.

Anyway – “death” is nothing special in Unreal, so it’s entirely up to you.

Because you’re in the GUI, it means you’re on the player authority node, which means that you can get the controlled pawn for the player controller, and just destroy it.
Then call some RPC to the server so it knows to do the right thing.

1 Like

I tried this and it doesn’t work.

I tried this and it doesn’t work

Here is a hacky way to do it. So will continue to research. You get the controlled pawn from the Owner Player Controller. Then you access the Ability System Component so you can apply an effect. This is where the “hacky” part comes in. I apply GE_Damage_Melee. The Melee attack is a one-hit kill, but if this damage ever gets modified or the player gets boosted armor somehow, then this will no longer be an instantaneous kill.

1 Like

You may need to send the request to the server side using a RPC.

On the server, unpossess the pawn and destroy it. Then respawn a new pawn for the controller.

Separately, when you say “it doesn’t work,” that’s not helping the forum help you, because what doesn’t work? What did you expect to happen? What actually happens? How do you see/know that that’s what’s actually happening? What are the symptoms/actions you see? We have to guess right now, so we may be guessing wrong.

1 Like

Thanks for the response. I had a player controller, so automatically I should have server authority correct?

In networked games, there is one player controller with PLAYER authority running on the client, and one player controller (for the same player) with SERVER authority running on the server. Except for listen servers, in which case the player controller for the hosting player only, will have both kinds of authority.

1 Like

Hello, I think you need to send gameplay event “GameplayEvent.Death” as it was said in this video: https://www.youtube.com/watch?v=HwQ7BrLVfJI - time 5:25.