I wasn’t able to find the answer on a Google search so I’m asking it here.
I want to show my widget saying “Gems: 500/500” if the player’s “Mount Fox Gem” variable is 500. I have the widget and the blueprints already increase the variable correctly, but I can’t figure out how to make a check if the variable is a certain number.
I also want it to run once so the widget appears for a few seconds and disappears.
When a player gets one of Gems fire an event to LevelBlueprint to check if player has earned all Gems (if Gems earned == 500). If true show your widget
You’re converting your integer to a bool which means that if the integer has a value of 0 it will return false and any other value will return true. Drag off the integer variable and search for greater.
Use “Get Player Character”. The “Cast To” nodes are a bit special in that they ask if the object input is of the same blueprint class, if they’re of the same class the cast will succeed and you can use any information related to that blueprint class. If they’re not the same blueprint class the cast to fails. In your case you’re asking if the Player Controller at player index 0 is of the blueprint class SheilatheFox.
Edit: If you drag off the “Get Player Controller” node and type in “Cast to” you will see what you can cast to from that node.
You’re creating a new widget so you need to add said widget to the viewport. Also the current setup will add a new widget each time it’s called, but you will only remove the last one you created.