Hello! I'm building a game where players build a course with draggable blocks in order to guide a ball to the goal. It is kind of hard to explain, but easy to understand when you play the game.
I want to limit the number of blocks the player can use on each level. At the beginning of each layout, I set a global variable called 'blocksAvailable' to a specific number, depending on the difficulty of the level. For instance, on level 1, I set the blocksAvailable variable to 5, so the player has 5 blocks to use.
I subtract 1 from the blocksAvailable variable anytime a player drags and drops a block anywhere other than the UI block (at the bottom of the screen) or one of the red barrier blocks.
Here is where the issue comes into play. If I accidentally tap one of the blocks I've already placed on the grid, it subtracts 1 from the blocksAvailable variable. Each block should only be able to subtract 1 from the blocksAvailable variable. I've tried to control this by using the "Trigger Once While True" system event, using a variable called "placedOnGrid", and a couple of other ways I can't recall right now. None of my attempts have solved the issue.
Eventually, I want to add the ability to flip blocks along their X axis by double-tapping them. This won't be possible if I can figure out a way to resolve this issue. Any help that can be provided would be greatly appreciated.
Please let me know if any additional information is needed.