Widget Troubles

Hi all,

Last week I was doing a game challenge and had to give up because I ran into problems.

Basically, my idea is for a puzzle game (actually it’s not, I want two game modes to alternate back to back, but I am only having trouble with the ‘puzzle’ part of the game). I want a 6x4 grid of empty slots surrounded by a 8x6 perimeter of 24 pieces which users can drag into the empty slots (and one of which is ‘fake’). Then the level starts based on the completed puzzle.

I have been following the ‘HTF Do I: Drag and Drop’ tutorial on youtube and have to say it’s not very helpful.

At the moment I have created a ‘main’ HUD. Inside my main HUD my idea was to place the puzzle pieces, each of which has ‘on drag detected’, ‘create drag & drop operation’ etc. so I can drag and drop the pieces. Similarly each of my empty slots should inherit from a widget blueprint telling it how to react when a puzzle piece is dropped onto it.

So far, so good. But I want communication between the blueprints. E.g. if I make a base ‘puzzle piece’ class that can be dragged, how do I customise its appearance from inside my ‘main’ HUD? Similarly I need some kind of index on the puzzle pieces so the empty puzzle slots know when they are receiving the correct puzzle piece. I want to be able to set ‘image’ and ‘index’ as variables inside their respective blueprints and be able to manipulate them from another widget blueprint.

Any help welcome :).

EDIT: To clarify, in my ‘Main’ HUD I want a uniform grid with all the empty slots and all the puzzle pieces, all of which are instances of their respective widget blueprints.