

I hope that helps in some way, I may make a tutorial for just the sliding block component when I have some more free time here. If the number of correct positions is equal to the length of the block arrays, the puzzle is ‘complete’ and you can fire off whatever functionality you want off that.After it swaps the ‘Missing’ and ‘Moved’ Block, it updates the index position on those blocks, and then checks the current Index positions on all blocks against their correct positions.If that offset position is EQUAL to the position of the missing block, it will then swap the positions of the Missing Block and the Block to Move, using a temporary placeholder vector position variable to help the transition.For example, if you select ‘UP’, it will check the position of 1 block above each block in space. Once you the player, select a direction to move, the parent actor checks each of it’s child actors positions at an offset.This blocks positioned is kept track of as well. One block has the boolean ‘Is Missing Block’ set to true.For example, block 6 has a current index position of 0 (top left), but it’s correct position would be 5. Each block also keeps track of it’s current index position and it’s ‘correct’ index position.Each block has a location value, in this case we only care about the X and Z values of each block.I chose to set these up as child actor components within a parent actor, but there could be other ways to set them up. You have an array of X number of ‘Block’ actors, in this case 9.I am in the process of overhauling this entire Blueprint, and will update this answer with more information once complete! Sure, here is a link to a gallery of more screens:Įdit: - Added additional pictures showing the variables and descriptions for each - thanks Awliee!
