Making a build system, and I would like it to function similarly to 'classic' build tools, where the object would not clip through any other part. How would I do this?
Ok I tried my code and it did not work. The solution is to create a model containing just the part (the part has to be the primary part). Use a function called MoveTo()
which takes a vector3 value inside of it. Example
-- Example local Model = Instance.new("Model", workspace) local Part = Instance.new("Part") Part.Anchored = true Part.Parent = game.Workspace.Model Model.PrimaryPart = Part local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() local function MovePart() Mouse.TargetFilter = Part -- Ignores the part Model:MoveTo(Vector3.new(Mouse.Hit.X, Mouse.Hit.Y, Mouse.Hit.Z)) -- Not using CFrames end Mouse.Move:Connect(MovePart)
Hope this works!