Im scripting the arms where it would move up and down depending on where you look in first person.
the problem is, the arms would rotate too much causing a full 360 spin. is there any way to dampen the effect or scale it so it can only go from -80 to 80 for example
local RightShoulder = Character.RightUpperArm.RightShoulder
local LeftShoulder = Character.LeftUpperArm.LeftShoulder
local RightShoulderInfo = {
X = RightShoulder.C0.X,
Y = RightShoulder.C0.Y,
Z = RightShoulder.C0.Z,
}
local LeftShoulderInfo = {
X = LeftShoulder.C0.X,
Y = LeftShoulder.C0.Y,
Z = LeftShoulder.C0.Z,
}
RunService.RenderStepped:Connect(function()
local CameraDirection = Character.HumanoidRootPart.CFrame:ToObjectSpace(Camera.CFrame).LookVector.Y
if InFirstPerson == true then
SetCharacterLocalTransparency(0.3)
RightShoulder.C0 = CFrame.new(RightShoulderInfo.X,RightShoulderInfo.Y,RightShoulderInfo.Z) * CFrame.Angles(math.deg(CameraDirection),0,0)
LeftShoulder.C0 = CFrame.new(LeftShoulderInfo.X,LeftShoulderInfo.Y,LeftShoulderInfo.Z) * CFrame.Angles(math.deg(CameraDirection),0,0)
print(math.deg(CameraDirection))
else
SetCharacterLocalTransparency(0)
RightShoulder.C0 = CFrame.new(RightShoulderInfo.X,RightShoulderInfo.Y,RightShoulderInfo.Z) * CFrame.Angles(0,0,0)
LeftShoulder.C0 = CFrame.new(LeftShoulderInfo.X,LeftShoulderInfo.Y,LeftShoulderInfo.Z) * CFrame.Angles(0,0,0)
end
end)