I'm remaking an old mining game I made just for fun, and I decided to reduce lag by generating parts as you mine instead of having a billion preset parts. However, there was quite the flaw in my logic when I found that the block would go through the baseplate and cause all sorts of havoc. So I figured that I should simply just make the script not generate a block when it detects something in the way would solve all of my problems. Unfortunately, I don't know how to do that... How would I go detecting if an object was in the way?
EDIT:
sayhism1's answer did help, unfortunately, it seems like the Region3s are ignoring everything. Another problem I found was you could mine a block, but it generates in your direction. I attempted a fix, but you can exploit this glitch by going to a corner and then mining.

3 comments
Yeah, I had the same idea. I'll give it a shot if my raycast idea doesn't work
I'm not sure why, but it seems to be ignoring everything. I added a bit of code that shows how many parts are in the Region3 and it keeps on saying 0
Hmm... Are you sure you are using the right coordinates for Vector3?