I have a palette of different blocks (pBlock1, pBlock2 etc) in a family called Palette. "Palette" has a family instance text variable called blockType that varies depending on what type of block they should create when clicked on so pBlock1 has the variable set to "block1" and when it is clicked on I want it to create an instance of block1.
it would be like this: If mouse clicked on Palette -> Palette spawn instance (self.blockType)
is this possible or do I have to:
If mouse clicked on Palette
If Palette.blockType = block1 -> spawn instance block1
If Palette.blockType = block2 -> spawn instance block2
If Palette.blockType = block3 -> spawn instance block3
If Palette.blockType = block4 -> spawn instance block4
Imagine what this would look like if I have a palette of 50 (or more) different types of blocks.
There has to be a better way.. if anyone knows please do tell