Announcement

Collapse
No announcement yet.

Math not working correct ?!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Math not working correct ?!

    Hi,

    I'm working on a basic HUD that is displaying a highscore. Notification via interface is working finde but the math is working only the first time.

    First update:
    Score = 0
    newPoints = 5

    Score + newPoints = 5

    Second update:
    Score = 5
    newPoints = 5

    Score + newPoints = 5 expected: 10

    But why is it working the first time but then never updates the points?
    Click image for larger version

Name:	Blueprint.JPG
Views:	1
Size:	43.6 KB
ID:	1137007

    Thank you!

    #2
    Hey, KAEPS133, it might help to make a post like this on the AnswerHub.

    I think that it's not saving your score, possibly because the ReturnNode is returning a String rather than an Int.
    Just to make sure, try changing it so the newPoints during the second update is 6, instead of 5. If it's not saving your score, the Score+newPoints will be 6, instead of the expected 11.

    Let me know if this helps!

    Jonathan

    Comment


      #3
      Believe me when I say I shouldn't be answering posts on this forum (day 4 of using Unreal) but I can't see you storing the value of Score. You might need to set Score just after you've done your Score + newPoints.

      Comment


        #4
        Hello,
        it does not work because you don't update yur score at the end of the function you have to to a set score after this function so then score will be 10 and not 5 as first time.

        Comment


          #5
          Yes now I know what was wrong. The Set Score node was missing.
          Click image for larger version

Name:	Blueprint.JPG
Views:	1
Size:	28.5 KB
ID:	1053119

          Shame on me

          Comment


            #6
            This is how we learn ;-)

            Comment

            Working...
            X