You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I am trying to make a rocket launcher that destroys blocks in a radius when you click, I have used a region 3 with FindPartsInRegion. -
What is the issue? Include screenshots / videos if possible!
Some blocks do not get deleted by FindPartsInRegion.
Here is a video:
The white boxes are the region3s.
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried to run FindPartsInRegion twice to see if that would help, but it does not seem to.
I have tried to make 2 region3s but that doesn’t seem to work either.
Here is the code:
local lp = game.Players.LocalPlayer
local mouse = lp:GetMouse()
script.Parent.Activated:Connect(function()
local target = mouse.Target
if mouse.Target:FindFirstChild("ColorCorrection") then
print(target)
local Min, Max = target.Position - (2 * target.Size), target.Position + (2 * target.Size)
local region = Region3.new(Min, Max)
local parts = workspace:FindPartsInRegion3(region)
local part = Instance.new("Part")
part.Size = region.Size
part.Position = region.CFrame.Position
part.CanCollide = true
part.Anchored = true
part.Transparency = 0.5
part.Parent = game.Workspace
game.ReplicatedStorage.RemoteEvent:FireServer(parts)
for i, v in pairs(parts) do
if v:FindFirstChild("ColorCorrection") then
v:Destroy()
end
end
end
end)
EDIT: I forgot to mention that the Colour Correction is for filtering out what parts to destroy.
Any help will be greatly appreciated.