Download

Register last hit by on actor with health

I am working on a networked top-down simple win / loss condition. I have a cylinder in the middle of the map with HP. When a player controller hits “a” on the keyboard they run a event on server that decrements the health of the cylinder. Once the cylinder has no health I have a event that is triggered on the gamemode class to set the endgame boolean to true and display a endgame widget for all player controllers. The end game widget just has a text with who won and lost. This all works except I cant figure out how to reference the player who hit the cylinder last to set them as the winner.

I tried storing a player reference on the cylinder, but because it is being ran on server it seems the server is the only reference that is ever set. I am pretty sure setting the last hit reference on the cylinder actor would be the easiest but not sure what to use as a way to check it with gamemode or using another method.

Any suggestions?