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)