Console getting flooded with unable to cast instance to cframe

hello i was making a gun (kind of) game and while trying to make a arm system, the console gets flooded quickly, i dont know what causes it.
em

remote code:

	if player.Character then
		if player.Character:FindFirstChild("Torso") then
			local rightshoulder = player.Character.Torso:WaitForChild("Right Shoulder")
			local leftshoulder = player.Character.Torso:WaitForChild("Left Shoulder")
			local neck = player.Character.Torso:WaitForChild("Neck")
			rightshoulder.C0 = rightshoulder.C0:Lerp(co1,0.3)
			leftshoulder.C0 = leftshoulder.C0:Lerp(co2,0.3)
			neck.C0 = neck.C0:Lerp(co3,0.3)
		end

client arms code:

if mouse.Target == nil then return end
local hit = (torso.Position.Y - mouse.Hit.Position.Y)
local mag = (torso.Position - mouse.Hit.Position).Magnitude
	local offset = hit/mag
	local c1 = (CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) * CFrame.fromEulerAnglesXYZ(0, 0, -offset))
	local c2 = (CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, offset))
	local c3 = (CFrame.new(0, 1, 0, -0, -0, 0, 0, 0, 0, 0, 1, 0) * CFrame.fromEulerAnglesXYZ(offset, 0, 0))
	remote:FireServer(a,c1,c2,c3)

Can you provide a screenshot of the coding so that I can see the line where the error is coming from?

em
em

erm… the code was already typen in the quotes, i guess have these?

is that co1 on line 11 a part?

em
c01 is not a part.
this is the issue, i dont know if its a part or a roblox bug

so what is the purpose of that co1 on the script?

i think your going offtopic.

co1 is the mouse position, i WANT to make sure that arms and the head will follow the camera but not in a local script, i want PEOPLE to see what direction your looking in, just like pixel gun 3d.

I apologize, I was just making sure to know of what co1 was doing because that seems to be the problem of what’s causing the error.

figured out the issue, turns out the co1 was actually the player variable cause theres a issue with remote events.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.