I'm trying to make a game where the player builds towers by putting different sorts of objects on top of each other.
I am able to create multiple objects on top of each other as long as the object is the same, but when I change the type of object to place, things go weird.
Let me explain with an example:
This is a project where I create objects on button click:
With this code:
In that project, I have another button to change the type of square to place next. So when I click the button place orange boxes if the type is 0, place green boxes if the type is 1. (green boxes have different size than orange boxes btw). This is what I'm trying to create but I am failing miserably:
Instead of this, I get green boxes created irrespective of other blocks' positions. I tried couple of things but then decided to stop trying not to complicate things, you can download the sample file here:
Thank you in advance!