Collect 10 coins and get certain amount of food or similar

I am in third person and have created a little quiz using widget blueprints with three answers to choose from. How would I add coins after every correct answer. Which graph would I put this in? Also if I was to collect for example 20 coins how would I add a certain amount of food for example? Which graph would I put this in? I am only a beginner. If possible can you show me screenshots or describe it thorough.

In ThirdPersonCharacter blueprint you would add Integer variable “Coins”

In the Widget blueprint (in my case, named “QuizBP”) you would cast to thirdpersoncharacter ( to get access to Coins integer ) then SET the amount of coins to be (Coins you had) + (10)

This is how you can show the amount of coins on your screen, by creating a binding:

and getting the value of coins, inside of that binding:

I hope this helps :slight_smile: Good luck

Also I would add the food integer in the ThirdPlayerCharacter blueprint aswell, similarly to Coins.

Pretty much this setup, a couple things though. This will add +10 coins for a correct answer. I think the OP wanted probably +1 coin for each correct answer and then something special to happen when the player reaches 10 or 20 pts. There would need to be added nodes after the “correct” answer is chosen and a coin/s added to then check how many coins the player has against the target (10 or 20) coins to receive a reward of “food”. Also, to be a true quiz, there would have to be some logic that allows for switching of the “correct” answer key, currently this setup would only work with a hard coded correct answer button. So perhaps a boolean for each button (1 is correct, 2 is correct, 3 is correct etc) and you will have to set one of these to true all others to false. So if a player selects the incorrect button some error will pop up or change the button color to red etc but if the correct button is chosen it will add coins to the player score. As for the food stuff, that would be another variable and I am sure some other widget image or progress bar etc to display the added “food” to the player. Try some of these suggestions above out and let us know how far you get :slight_smile:

Thank you I got it working

Np, you should mark the question solved :slight_smile: