I’ve recently added a leaning mechanic to my game and it works fine if the player is not in first-person. When in first person, the player will be turned to the left or right (depending on what direction they are leaning) as well as tilted.
example of what that looks like
Here is what I do to make the player lean
function gun.LeanChar(plr, tool, direction, jointC0Origin, joint)
if direction == "Middle" then
game:GetService("TweenService"):Create(joint, TweenInfo.new(0.7, Enum.EasingStyle.Quart, Enum.EasingDirection.Out, 0, false, 0), {C0 = jointC0Origin * CFrame.Angles(0, 0, 0)}):Play()
elseif direction == "Right" then
game:GetService("TweenService"):Create(joint, TweenInfo.new(0.7, Enum.EasingStyle.Quart, Enum.EasingDirection.Out, 0, false, 0), {C0 = jointC0Origin * CFrame.new(-0.5, 0, 0) * CFrame.Angles(0, -0.35, 0)}):Play()
elseif direction == "Left" then
game:GetService("TweenService"):Create(joint, TweenInfo.new(0.7, Enum.EasingStyle.Quart, Enum.EasingDirection.Out, 0, false, 0), {C0 = jointC0Origin * CFrame.new(0.5, 0, 0) * CFrame.Angles(0, 0.35, 0)}):Play()
end
end
(“joint” is the player’s RootJoint)
If there is no way to fix this issue with the joint, is there any other way to make the player lean like this?