Help with explosion tile system

  1. What do you want to achieve?
    Hello again! I am trying to make a explosion tile system for the bombs in my game, which go in a + shape, similarly to Bomberman’s explosions.

  2. What is the issue? Despite being in a loop, the section where it checks if its touching other explosions only executes once.
    I’m using the script below:

if MaxDistance > MaxPower.Value
	for _ = 1, MaxPower.Value do --if Max Power is 5, it will clone the tile and move it 5 times
		local ExplosionTileUp = ExplosionTile:Clone()
		ExplosionTileUp.Parent = bomb
		local TileCheck = workspace:GetPartsInPart(ExplosionTileUp)
		if #TileCheck > 0 then
			task.wait(0.001)
			ExplosionTileUp.CFrame = (ExplosionTile.CFrame + Vector3.new(0, 0, -6))
		end
	end
end

And here is how it currently looks ingame (it’s supposed to only go upwards for the moment):
image
Any help is appreciated. Thank you!!

Wdym only executes once??? Can you elaborate

1 Like

It only checks once if the tile is touching another tile, thus moving it only one tile and only creating one clone, even tho its in a For loop

1 Like