Hi! I’m trying to create a Coin Pickup system that also update in a Widget Bluprint in Blueprint but since i’m new to ue, I can’t seem to able to create what I want. Here screenshot of the blueprints (the first one is the pickup Blueprint and the second one is the Widget Blueprint)
Hey @tristan.inc! Welcome to the forums!
So first thing I’m noticing is that in your first picture, you’re incrementing, but you’re not setting the new value to score. So you want to use a “Set Score” node after what you have, and pass that float in.
However, having it happen before destroy actor will make none of that matter. Make sure “Destroy Actor” is the last thing you have on an actor’s code line, because anything afterward will not fire as the actor doesn’t exist any longer.
And lastly, you’ll want to have your score be stored on game mode.
Open your game mode and make a variable called “Score” and then on your coin use:
*Get Game Mode,
*Get Score,
*use an addition node (not increment) to add 1, *SET SCORE again to the new value using the “Get Game Mode” node,
*and then Destroy actor.
For the second picture, your cast will not work because casting is just “act as if the object plugged in is one of these” and gamemode is not compatible.
If you do what was listed above, now you can simply “Get GameMode”, “Get Score”, and then plug that into your return node as text