RunService.RenderStepped:Connect(function()
local MouseRay = Mouse.UnitRay
local CastRay = Ray.new(MouseRay.Origin, MouseRay.Direction * 1000)
local IgnoreList = {ClientObject, Character}
local Hit, Position = workspace:FindPartOnRayWithIgnoreList(CastRay, IgnoreList)
---ClientObject.PrimaryPart.Position() -- Attempt to call User Data Value, Fix Later
if Hit and (HumRoot.Position).Magnitude < MaxPlaceDist then
CanPlace = true
else
CanPlace = false
end
local Angles = CFrame.Angles(0, math.rad(YOr), 0)
local NewCFrame = CFrame.new(Position.X, Position.Y + YOffset, Position.Z)
ClientObject:SetPrimaryPartCFrame(NewCFrame)
end)
UserInput.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.R then
RKeyDown = true
local RotationSpeed =5
while RKeyDown == true do
wait()
if Placing == true then
YOr = YOr + RotationSpeed
end
end
end
end)
I tried to add waits, I made sure there was a primary part to the model. IT works fine up until this point and beyond. The error its running is 00:34:01.643 - Model:SetPrimaryCFrame() failed because no PrimaryPart has been set, or the PrimaryPart no longer exists. Please set Model.PrimaryPart before using this.
00:34:01.644 - Stack Begin
00:34:01.644 - Script ‘Players.samjay22.PlayerGui.ScreenGui.ClientPlacment1’, Line 50
00:34:01.645 - Stack End
00:34:01.660 - Model:SetPrimaryCFrame() failed because no PrimaryPart has been set, or the PrimaryPart no longer exists. Please set Model.PrimaryPart before using this.
And its spamming my logs. I dont know how to fix this, i spent a while looking for this error to no avail. Please help.