Cast to Character using Player State?


I’m currently trying to run a script (“Game Over Screen”) from the MyCharacter blueprint (see picture below) and I need to cast to it, because I’m in the “NewGameState” blueprint (it’s my custom Game State). The only information that I have is the Player’s State. Is there a way to cast to a Character using a Player State?

There is no picture , but i think this is what you need

Sorry, I’m a dummy (and a bit tired) ! I uploaded the picture and just realized, how simple the solution is (I forgot that the ForEachLoop outputs an array index that I can use in this case). Thank you very much :slight_smile:

But BTW, is there a way to use a player state to cast to a character, or is that impossible?

Player State does not know about Pawns.

Create a GameOver Event Dispatcher in the Player State for the trigger, and have the Character bind an event to it when possessed. This way you can have the Character react to an event in the Player State without the Player State having to know about the Character.

Event Dispatcher documentation: Event Dispatchers | Unreal Engine Documentation

Thank you for your answer. Sadly, even with the documentation, I couldn’t wrap my head around how these event dispatchers work and how I can use them as you’ve described. I’ll use Mhousse’s method for now, but if you’re willing to help, I’d love to try your solution.