How to remove Character glitching

My server script:

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local con = Instance.new("HingeConstraint",char:WaitForChild("UpperTorso"))
		con.LimitsEnabled = true
		con.LowerAngle = 0
		con.UpperAngle = 0
		con.Name = "hc"
		char.UpperTorso.CanCollide = false
		con.Attachment0 = char.UpperTorso.WaistRigAttachment
		con.Attachment1 = char:WaitForChild("LowerTorso").WaistRigAttachment
		char.UpperTorso.Waist.Enabled = false
	end)	
end)

Local script:

local run = game:GetService("RunService")
run.RenderStepped:Connect(function()
	if game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait() then 
		local hc = game.Players.LocalPlayer.Character:WaitForChild("UpperTorso"):WaitForChild("hc")	
		local ang = (workspace.CurrentCamera.CFrame.LookVector.Y * 90) * -1
		print(ang)
		hc.UpperAngle = ang
		hc.LowerAngle = ang			
	end
end)

as said, this script makes the character to look up or down according to the camera, just like in Arsenal.

But my problem is, the player’s character glitches and double jumps, etc.

I would be grateful for any help and any other advices!

Setting HumanoidRootPart's CanCollide property to false made it work better for me.

1 Like