When and how to use prefabs in a 2D puzzle

Hello guys, I hope someone can give me advices about what I want to do.

I’m making a 2D puzzle with 7 different patterns in my blocks created like prefabs, I want that they appear by pairs, so, I have a spawner that make them appear randomly, after this, I have the intenton that, for example, when 3 or more blocks with the same pattern touch themselves, disappear, but here comes my problem:

which is better?

  • Make them appear like a prefab compound of 2 blocks or
  • Manage the prefabs only compound of one block.

The problem I have with this is that when one block of the pair disappear, I’m going to control the remaining block but if it is a prefab compund of 2 blocks I don’t know how to control it.

Other issue with this is that if I make prefabs compound of 2 blocks, I would have to make 49 differente prefabs because the combinations of 7 patterns and this doesn’t seem practical to me.

How do you see my problem, can someone give me advices?

Thank you.

Can you randomly pick a block then use an if statement to say what must be picked next & instantiate both of them before looping through to pick the next random block? That way they are all instantiated as individual items.

Ohhh I see, let me try doing this, thank you :smile: