Can't Add Score When Hit

I set up a system where you collide with an object and it gives you a point to the HUD score system and the first person template. It works fine there. I try to do the same steps in the flying pawn template, but I can’t seem to add the score in the HUD. I followed this tutorial: https://docs.unrealengine.com/latest/INT/Videos/PLZlv_N0_O1gbY4FN8pZuEPVC9PzQThNn1/sNueIWCKoco/index.html.
The print string function triggers, so the collision is registering, it just won’t add a score to the HUD counter. Anyone have any ideas why the counter is not registering on the score?

alt text

Hello DMHokie,

I can’t quite tell what the issue is from what I’m seeing at the moment but as a bit of debugging, I would suggest checking the value of Total Score when you add to it and also when you cast to FlyingPawn in your Widget blueprint.

Also, hook something up to the Cast Failed pin in the Widget blueprint to ensure that the cast isn’t failing for some odd reason.

If I add a print string to my set Totalscore in the Flying Pawn, the print string shows the correct score. It goes up in my increments as I collide with boxes. If I hook up a print string to the cast failed in the widget, it immediately and constantly fires the string. Does this imply that cast is constantly failing and that’s why it won’t translate the totalscore to the hud?

103099-flyingpawn.png

That would be it. I think I know why. FlyingPawn is just that, a Pawn. Try using GetPlayerPawn instead of GetPlayerCharacter for the Object for that cast. That should return the right reference for you.

You’re a genius! That was all it was. Thanks