Cast to HUD from owning PlayerController

Hello there,

Im having problems in casting to my HUD from my PlayerCharacter BP when having more than one Client.

I want to call a custom event (which plays a get hit animation) in my HUD class whenever my player is hit by a projectile (by detecting when the projectile overlapped my collider). In my PlayerCharacter BP I have this:

The problem here is that while it works fine in singleplayer, whenever I have more clients connected this event is called on all Players which results in all players “getting hit”. Im 90% sure its because GetPlayerController is called on PlayerIndex 0. How would I handle this, to let it fit to my needs?

Also I’m not sure if it has to do with replication because nothing I set up for the animation is set to Replicate.

Thank you in advance.

Hey there, if that code is in the player character then you should use the Get Controller node followed by a cast to PlayerController instead of Get Player Controller.

wow thank you that was an easy fix