so i am making fake hands for my fps game this is the code:
game:GetService("RunService").RenderStepped:Connect(function() mytool = character:FindFirstChildOfClass("Tool") if mytool then righthand:SetPrimaryPartCFrame(mytool.tool.righthand.CFrame) lefthand:SetPrimaryPartCFrame(mytool.tool.lefthand.CFrame) mytool.tool:SetPrimaryPartCFrame(camera.CFrame) game.ReplicatedStorage.look:FireServer(camera.CFrame.LookVector.Y) end end
so in line 6 it moves the gun it works well 0 lag moves when i move but right before it one line 5 and 4 it moves the hands but the hands are laggy and when i move they move late so they go to right where they should have been 1 frame ago how do i fix this?
game:GetService("RunService").RenderStepped:Connect(function() mytool = character:FindFirstChildOfClass("Tool") if mytool then mytool.tool:SetPrimaryPartCFrame(camera.CFrame) righthand:SetPrimaryPartCFrame(mytool.tool.righthand.CFrame) lefthand:SetPrimaryPartCFrame(mytool.tool.lefthand.CFrame) game.ReplicatedStorage.look:FireServer(camera.CFrame.LookVector.Y) end end
Just move the arms after the entire model has been moved.