Character rotation happens only on Client, not server

I am using this script to bend character torso with the camera. It works fine, but the bending happens only on Client, and on the server he doesnt bend at all, as you can see in the video.

That is an issue, because lot of things depend on this bending. For example the bow is firing arrows that need to be CFramed with bow, but the bow CFrame is different on client and on server. As a result, the arrow should fly where the character is looking, but doesnt because char lookVector on client and on server are different.

How can i make the bending appear on Server too?

local runService = game:GetService("RunService")
local char = game.Players.LocalPlayer.Character


local c0 = char:WaitForChild("UpperTorso"):WaitForChild("Waist").C0

function updatewaist()
	local cameralookvectorY = workspace.CurrentCamera.CFrame.lookVector.Y
	local radian = math.asin(cameralookvectorY)
	char.UpperTorso.Waist.C0 = c0*CFrame.fromEulerAnglesYXZ(radian,0,0)
end


runService.RenderStepped:Connect(updatewaist)

1 Like

I know i could fire remote event to a server script that does the same thing. But firing a remote event every frame seems a bit too too too too very horrible amount much excessive and heavy on performance

Why don’t you just make it server sided? (put code in server script)
I know its not good for performance but thats the only way.

I cant make it server sided because Workspace.CurrentCamera is different for every player. And i cant set it from a local script then use it in a server script without a remote event, which is not just bad for performance, it is Apocalyptic for performance.

You’re gonna have to use remote events, to decrease lag you can fire it every 0.1 seconds instead of every frame.

Individual parts Position, Size, Color etc does not replicate from Client to Server, you will do like @Katrist said.