Make new brick when part collides

So im trying to make a bubble machine that actually drops bubbles (yes, actually) and i wandered around the internet for some solution and i couldnt find one that was related to this so
How can i make a part make another part on the position it collided on?
if its not possible, i understand. otherwise thanks for the help!

Check for collision on the object you want to make create a bubble, 2 ways you could make a bubble, you could create a brick and configure it using Instance.new, but it be easier to store a premade bubble then use :clone()

thats something i was thinking of doing
thanks for suggestion

If you’re making an object with little to no properties, then Instance.new() is faster than :Clone().

For your original question, a .Touched event works fine.

local bubblepart = game.Workspace.bubblepart

bubble part.Touched:Connect(function(hit)
if hit.Name = bubblepart then
bubblepart:Clone()
wait(1) -- else once it's cloned it will immediately touch another bubblepart
end
end) 




local bubblepart = game.Workspace.bubblepart

bubble part.Touched:Connect(function(hit)
if hit.Name = bubblepart then
Instance.new("Meshpart")
Meshpart.Meshid = "insert it here"
Meshpart.Position = bubblepart.Position + (0, 1, 0)
Meshpart.Color = bubblepart.Color
Meshpart.Size = bubblepart.Size
Meshpart.Name = bubblepart
end
end)






See if this works, if not, check for script errors or check the output for errors

actually i worded the thing a lil wrong.
something that fits more would be a foam machine but still thank you all so much anyway

1 Like