How would you approach this situation in Unity. I’ve seen it done before, but have never been able to figure out how to actually do it,
here’s an example
You can see that the bricks in this video when placed next to each other join together and form one block when next to each other.
and they have a rounded corner if you place them in an L shape
how would you setup something like that in unity where you can lay out cubes and they would dynamically change shape depending on what other cube was next to them?
thx
I doubt that was automatic in this case, but it could have been, so we’ll pretend it was.
There’s a few different ways to handle it, but I’d probably have each block handle itself by checking the blocks next to it. Then you could just have a preprogrammed list of shapes for it to be according to whether or not there are blocks in the 4 positions around it.
That’s a really simple way to do it, but there are plenty of ways to optimize it.
Delete one of the blocks then scale out the first block into the place of the block it joined with?
Either that or delete both blocks and just create a block in the exposed gaps.
You could use an array of block grid positions to manage this.