Hey sorry didnt give explanation. That custom event is un-necessary, it’s a habit I do for being able to re-apply references if there is an issue, but I usually also add in ID checks to get the exact reference. Also you can name custom events whatever you want for your project’s organization.
Beginplay isnt in widget blueprints, its called Event Construct there.
I built all that code on the player character. For singleplayer it can be technically built anywhere but for organization purposes its easier to use a defined method. Where as multiplayer has a more strict organizational structure. How you do that is up to you and your project. For example, you have the player’s turn variable located on the puzzle block BP, this can sometimes get confusing, but it can work. Although an easier organizational method would be to put it on the player controller or character because it is their turn right? But that is another discussion. Here is some documentation to help understand that: https://docs.unrealengine.com/en-US/Gameplay/Framework/QuickReference/index.html
No that is not a problem. The Event Beginplay node is code that is run when the object is spawned into the world, which can be game start or later during runtime. For references they need to be set by code called prior to needing the reference, you can create a reference right before using it or set it up when the object is spawned. It depends on what your project needs.
If you are using the puzzle template start it already has an onclicked event for the puzzle blocks, you wouldn’t need a HUD to make that event, unless of course you want to for your project’s needs.
Here is an example using the default selection method in puzzle template.
Only thing extra I did was add an integer variable to the puzzleplayercharacter for player turn and set it to 1. Now anytime you click on a block it will increase the player’s turn by one. There are other ways to do this using interfaces or event dispatchers, but this will work. You can use that same code in your onclicked event in your HUD and it will work as well. This is direct blueprint communication using casting, if you want to do it as a reference you can do it this way:
Essentially they are the same thing, although some can argue that one way is more optimized and efficient than the other. This is also how you set a reference for when the blueprint is spawned. Widget blueprints use Event Construct in place of Event BeginPlay, there are some slight differences between the two but for your purposes it shouldn’t matter. Hopefully this cleared some things up.