Hey guys, so I created a script, shown below, that changes the character's neck Motor6D's CFrame so that it rotates the head according to the player's mouse position every renderstep. It works great and all, except the movement has a slight lag to it. As you may have noticed, since I am using Filtering Enabled, I was wondering if calling the server every renderstep was what was causing the problem, or if it was something else. I would really appreciate it If someone could help me in finding a solution that will either eliminate or greatly reduce this lag. Thanks in advance
--All variables defined above
--Client
runService.RenderStepped:connect(function()
local character = player.Character
local torso = character:FindFirstChild("Torso")
local neck = torso:FindFirstChild("Neck")
if torso and neck then
cameraEvent:FireServer(x, y, neck) --Move neck (FE)
end
end)
--Server
cameraEvent.OnServerEvent:connect(function(player, x, y, neck)
neck.C0 = CFrame.new(0,2,0) * CFrame.Angles(y + 0.1,0,0) --Head simulation
end)
