Can anyone tell me why the variable goes into the negatives instead of aborting the substraction and creating the widget?

When i launch the game, the variable for the amount of diamonds the player has goes into the negatives when they don’t have enough diamonds. Can anyone tell me what’s wrong here?

What is wrong is your editing style. That is simply unreadable man.

Sorry, but that’s a mess of a blueprint. It’s really hard to track everything that’s going on. Try refactoring your logic somehow.

One thing that I spot is that sometimes it can happen that the GetAllActorsOfClass hasn’t been called yet, but the top-left branch needs the Diamonds value that is inaccessible. Might that be the issue?

You may be right. The one in the top left gets the variable from the character, and when it’s less than the diamonds required, then it will trigger the branch as true and it will create the widget that says the user doesn’t have enough. That’s what it’s supposed to do. I’ve tried switching the aligator symbol to < but instead it won’t let the user buy the pass when they have enough either. I’ll try your solution and come back and tell you what happens.

Here’s the error i get after closing the preview:
Blueprint Runtime Error: “Attempted to assign to None”. Blueprint: AreuSure Function: Execute Ubergraph Areu Sure Graph: EventGraph Node: Set Diamonds

… Wow … I remember thinking it was such an amazing addition, the reroute nodes…

That is definitely to 5 most confusing I’ve seen posted here.
Let me see if I can rework it to functional.

I’ve been over this a hundred times and I can’t reproduce the problem.
I’m not going to try to duplicate your reroutes to see where those might be causing it, but doing it cleanly does not have the issue so I am going to say that is where your problem lies.

This works 100% of the time for me.

In my version the character doesn’t change so I’m getting a reference to it in the blueprint’s BeginPlay.

I even tried a few variations on how you might be using this to see if I could find a similar problem… they all worked fine.

It must be in all of those excessive reroutes.

This is what I was testing with. [Diamonds][4]
If you can break it the same way we’ll know where the problem is.

If you decide to break the test game…
TAB toggles to / from mouse mode to click the items.