To display the widget above the peices to pickup and also to pick them up with E I wrote.

The when E pressed runs a macro which runs:

Which defines which piece changes which variable in the UI hotbar. The which piece to collect variable is defined by:

Which gets the class from the line trace and sets the integer number for each type.
The tile selection to place onto I spent alot of time rewriting to work slightly better and this is what I ended up with which still wasnt perfect.

To hold the pieces in the air before placing I wrote:

Which I thought was pretty smart as I used the same piece of code for all 4 types of peices by using variables which I changed to define the spawn paramaters.
To place and pickip pieces onto and from the grid the code was pretty simple.

The Unsnap from tile event is shown below:

Leave a Reply