Announcement

Collapse
No announcement yet.

What Am I doing wrong?

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

    What Am I doing wrong?

    I'm trying to make a scoring system for my first game. What am I doing wrong? It's giving me this notice and the my script doesn't work at all. :/
    Attached Files

    #2
    Each possible execution path should have a return node, here Cast Failed doesn't.
    The cast is probably failing if you are getting no result, is PhysicsBallBP actually the owning pawn of the widget?

    Comment


      #3
      Thank you for the respond man I managed to get rid of the note by putting another return node on the cast fail. But I think for some reason, it's always failing.
      Would you mind telling me what's my mistake here? Sorry I'm new :'(
      Click image for larger version

Name:	2.png
Views:	1
Size:	305.4 KB
ID:	1092066
      Click image for larger version

Name:	1.png
Views:	1
Size:	308.1 KB
ID:	1092067
      Click image for larger version

Name:	3.png
Views:	1
Size:	237.6 KB
ID:	1092068

      Comment


        #4
        Right click and put a breakpoint on your code and see what happens. Print string is also very handy too for debugging what values you are actually getting while you play

        Comment


          #5
          There's a few things that could be wrong here.

          Firstly, you haven't actually fixed the original problem, your return node for Cast Failed, is still getting a variable from PhysicsBallBP, but if the casts has failed, it won't be able to do that, giving you an error. Ideally your cast would never fail if you're doing things right but still it shouldn't be set up like that. If the cast fails, return no text.

          Your OnOverlap event looks ok, but is it possible for something that isn't PhysicallBallBP to overlap the mesh? Because if it does, the cast will fail. Like ZoltanJr said, you should put in some print strings to see what's working. You can compare the class of the overlapped actor using the == node, to see is it equal to PhysicsBallBP, and only cast if it is. Definitelt make sure that overlap event is actually working though with some print strings.

          Also, is PhysicsBallBP actually a pawn? Is it the pawn your user possess when playing, or is it just an actor?

          Comment


            #6
            Can I ask why you have a separate blueprint to add your UMG Widget? I'm not sure why it is needed.
            If I were doing this and it was a single player game, I'd put everything on the player controller or character.
            When your pawn overlaps the score BP, you can update the UMG from the controller or character...don't need the function on the UMG at all.
            Tracey White - Senior Design Visualization Artist / PC Game Enthusiast / Drummer
            My Maze Game development video series
            My Maze Game Blog

            Comment

            Working...
            X