local player = game.Players.LocalPlayer local Mouse = player:GetMouse() Mouse.Button1Down:Connect(function() local part = game.ReplicatedStorage.Model:Clone() part:SetPrimaryPartCFrame(CFrame.new(Mouse.Hit.Position)) part.Parent = workspace end)
Everytime I click, it spawns in workspace, but some of it spawns inside the ground. How do I fix this?
You Might want to add an off set, to do that you add a vector 3 Value onto the CFrame. For Example:
part:SetPrimaryPartCFrame(CFrame.new(Mouse.Hit.Position)) + Vector3.New(0,1,0)
This Offset will Make the CFrame 1 stud Higher than it usually is