So I’m making this sort of a 3D tetris game where the main point is to create as tall towers as possible. The data I need from the towers is the height and position. At the point of the tower the tower creates an influence radius, where the player is able to place more blocks. At the moment I have my game board where players drop pieces and I have two different block prefabs at the moment. Straight line block with one box collider childed to it and L-block with 2 box colliders respectively.
Now the problem is I can’t figure out how to get the height of a tower. And I need to be able to get the bottom blocks position to get the point where the tower is. The tower height should be the absolute highest point measured in a 90 degree angle from the bottom block to the tip of the tower.
So here the middle tower should be the highest. and the third one should be a bit higher than the first one as the block is a bit diagonally and reaches higher. Block count does not affect the outcome. Only the height.
Should I do something with some sort of child structure? So that every time you stack a block it goes in to a tower hierarchy?
Or maybe try to get a height map and locate the tower from that?
I really don’t know how I would do either of those, but those solutions sound somehow logical maybe… I would be really glad if someone atleast points me to the right direction. Almost forgot: I use C# for my scripts if that matters to you all.