I was gonna use either :GetTouchingParts() or .Touched, however both have their flaws. In particular that they may be too taxing (being called every RenderStepped) or that they will return results in blocks are adjacent. I only want something to fire if there is directly a block in it
I am running this from RenderStepped, so it needs to thus not be taxing on the client.
Is this a grid based system? The easiest way would be to just keep track of all your placements in some data structure, and rather than checking parts you just lookup in your data structure “did I already place something here?”.
Ye, that’s what I’ve started to try attempting, however there’s problems with that, like 2 slabs can be be placed in the same “3x3x3” cube area, as those 2 slabs make up 1/2 a full block.
So like my instance there, I need it to detect that since you trying to place a full block in a spot that only a slab can fit in, it should prevent that. A slab however should be allowed to place in that position
If you really want to detect touching parts just use GetTouchingParts() function but I might be wrong beacuse I’m not using this too usually. But there’s the other solution beacuse you can use module or table to check if this grid is free or not and get size of block you want to place and divide it on grid size so you get it’s size in grid numbers