local NewZ = --value in radians
local OldCFrame = Rshoulder.C0
local OldX, OldY, OldZ = OldCFrame:ToEulerAnglesXYZ() -- This function returns CFrame's Angles in Radians
-- Get Old Position, and Old X and Y angle values, and set the new Z value
Rshoulder.C0 = CFrame.new(OldCFrame.Position) * CFrame.Angles(OldX, OldY, NewZ)
but im having a issue with how am trying to use it
first vid is using cframe.FromOrientation
second vid is cframe.Angle
am trying to achieve the first video effect but properly on the arm like this
i wanna make it so if the cameras looking up, the camera will follow heres the script am using
local Camera = workspace.CurrentCamera
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Rshoulder = game.Players.LocalPlayer.Character.Torso["Right Shoulder"]
game:GetService("RunService").RenderStepped:Connect(function()
print(workspace.CurrentCamera.CFrame.LookVector.Y*90)
local cameradirection = workspace.CurrentCamera.CFrame.LookVector.Y*90
local NewZ = math.rad(cameradirection)--value in radians
local OldCFrame = Rshoulder.C0
local OldX, OldY, OldZ = OldCFrame:ToEulerAnglesXYZ() -- This function returns CFrame's Angles in Radians
Rshoulder.C0 = CFrame.new(OldCFrame.Position) * CFrame.fromOrientation(OldX, OldY, NewZ)
end)
local NewZ = --value in radians
local OldCFrame = Rshoulder.C0
local OldX, OldY, OldZ = OldCFrame:ToOrientation() -- This function returns CFrame's Angles in Radians
-- Get Old Position, and Old X and Y angle values, and set the new Z value
Rshoulder.C0 = CFrame.new(OldCFrame.Position) * CFrame.fromOrientation(OldX, OldY, NewZ)
Edited script from @FP_Nation script with the fixed orientation order