Hi, I’m trying to create UI for a personal project.
I’ve got a fixed camera looking down at the world and the score HUD in position.
&stc=1&d=1449896984
The scene spawns cubes – when I click one it gets destroyed, here I want to update the score with an integer.
I’m looking for some direction, should I use dispatchers to speak from the cube to the hub text? What nodes should I use?
Any help/links to similar tutorials are appreciated.
Just create a variable and have it so when you click the cube you add so many numbers to the variable then have the text read the variable to print on the screen.
@anonymous_user_022ea499 Hey thanks for reaching out! I created a variable in the Event Graph of the RedCube and had it print “1” when clicked on. There was some simple blueprint adding 1 to the variable.
Problem was that once the cube was destroyed and I clicked on the next one it would print “1” again.
Go to this thread and look at how I set my coin pickup BP up and you should be able to get the similar thing u want for your score. Every time you click the cube you will ADD + however many points u want to set to a variable, then you will have your score widget call from that variable to display the total score.
Here is my reply to a guy with my BPs: Set number of item on screen - Blueprint - Epic Developer Community Forums
If you still can’t figure it out let me know and download teamviewer and I’ll come over and help you out.
I can’t seem to get cast to x working. Any advice?
Use the node "Cast to " and whatever your playable character is
Thanks Echosyp for helping me out! I finally got the thing working after getting additional help from a workmate.
Just wanted to post these images if anyone else in my situation happens to encounter the same problem.
Here the **Cube **Blueprint is casting to the **MousePlayerComponent **and then the
Addpoint function attached to it.
Here is a closer look at the **MousePlayerComponents **,**Addpoint **function.
And finally, here is a look at the
HUD widget, The **Get Player Score ** node is bound to text placed in the Widget.
Here the ‘Cast’ is getting the score element and returning it as the value displayed in the hud.