Cast to HUD from owning PlayerController
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.
asked Jan 10 '18 at 04:44 PM in Blueprint Scripting
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.
answered Jan 10 '18 at 05:05 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here