Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Setting the CFrame on a model spawns it in the ground a bit?

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?

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.