I have a script that makes a "wall decor" moved on only the x and y cords but the "wall decor" teleports on the roof when it collides with another part but not when it collides with another "wall decor." I think I might need to make it a CFrame. I can't figure out how though, I've tried many ways.
Add onto/fix this script: (make sure its a local script in starter pack.)
local player = game.Players.LocalPlayer local mouse = player:GetMouse() local mtarget local down function clickObj() if mouse.Target ~= nil and mouse.Target.Name ~= "Baseplate" and mouse.Target.Name ~= "Part" then mtarget = mouse.Target print(mtarget) mouse.TargetFilter = mtarget print (mouse.TargetFilter) down = true end end mouse.Button1Down:connect(clickObj) function mouseMove() if down and mtarget then local posX,posY,posZ = mouse.Hit.X,mouse.Hit.Y,mouse.Hit.Z mtarget.Position = Vector3.new(posX,posY,0) end end mouse.Move:connect(mouseMove) function mouseDown() down = false mtarget = nil mouse.TargetFilter = nil end mouse.Button1Up:connect(mouseDown)
Much appreciated it, Thanks!