x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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

alt text

Product Version: UE 4.12
Tags:
flying pawn.png (48.5 kB)
goal.png (84.2 kB)
score hud.png (97.9 kB)
more ▼

asked Aug 16 '16 at 12:11 PM in Blueprint Scripting

avatar image

DMHokie
68 15 26 36

avatar image Matthew J Aug 16 '16 at 06:11 PM

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.

avatar image DMHokie Aug 16 '16 at 06:43 PM

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?alt text

flyingpawn.png (50.7 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Aug 16 '16 at 06:47 PM

avatar image DMHokie Aug 16 '16 at 06:48 PM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question