local Part = Instance.new("Part") Part.Position = Vector3.new(0,20,0) Part.Parent = workspace Part.Touched:Connect(function() local RedPart = Instance.new("Part") RedPart.Position = Part.Position Part:Destroy() RedPart.Transparency = 1 RedPart.Size = workspace.Part.Size RedPart.Anchored = true RedPart.Parent = workspace RedPart:SubtractAsync(workspace.Baseplate) end)
im trying to make a part that falls down the air and when it touches the baseplate it removes part of the baseplate
You destroyed part before you accessed it's size. Change your code to this:
local Part = Instance.new("Part") Part.Position = Vector3.new(0,20,0) Part.Parent = workspace Part.Touched:Connect(function() local RedPart = Instance.new("Part") RedPart.Position = Part.Position RedPart.Transparency = 1 RedPart.Size = workspace.Part.Size Part:Destroy() RedPart.Anchored = true RedPart.Parent = workspace RedPart:SubtractAsync(workspace.Baseplate) end)
That should work
i fixed my problem it was because on line 15 it was
RedPart:SubtractAsync(workspace.Baseplate)
instead of
RedPart:SubtractAsync({workspace.Baseplate})
tho your code didnt fix my issue but thanks anyways