I'm trying to make Tetris, and I want it so that if there's a block below a piece, then it stops moving. (.Touched is unreliable, due to corner touching. And yes, I experimented with "center" blocks but .Touched didn't work because the part isn't unanchored, which I can't have.)
You can use Region3. wiki: https://www.robloxdev.com/api-reference/datatype/Region3. Here is something that should work for a single tetris cube:
local tetrisFigure= workspace.TetrisFigure --change this into the complete model of the falling tetris figure local cube = tetrisFigure.TetrisCube -- change this into a single (falling) tetris cube in the tetris figure. local reg = Region3.new(cube.Position-Vector3.new(0,cube.Size.Y+0.1,0),cube.Position-Vector3.new(0,cube.Size.Y+0.1,0)) local parts = game.Workspace:FindPartsInRegion3WithIgnoreList(reg, {tetrisFigure}) if #parts ~= 0 then --a part has been found under the cube --stop the cube end
NEGATIVES:
- you have to loop it constantly.
- you have to do this for every single cube in a complete figure.
POSITIVES:
- it has an ignore list, so if there are parts that you want them to fall through, just add it to the list.
- For me, region3 is accurate, and I haven't seen a region3 error for no reason at all.
-I haven't tested it, but it should work, if anyone finds an error comment it so I can fix it.