Hi other developers,
I’ve been lately running into this issue where I can’t set the CFrame of a new Clone of an object from replicated storage to the mouse’s CFrame.
Im currently attempting to create a placing system kind of like the one in a tds game.
This is my code:
local function CreateTurret(TurretID)
if TurretID == 1 then
local NewTurret = Turrets.TurretFirst:Clone()
NewTurret.Parent = NewTurretFolder
while true do
local TurretBasePart = NewTurret:WaitForChild("TurretBasePart")
TurretBasePart.CFrame.X = PlayerMouse.Hit.X
TurretBasePart.CFrame.Y = PlayerMouse.Hit.Y
task.wait()
end
end
end
Hi There StarJ3M, I’ve done what you said but now I have a error that says:
invalid argument #1 to ‘new’ (Vector3 expected, got number)
And then when I change it to a vector3 it gives me the error of CFrame expected