Hello, I was wondering if anyone could help me Offset the camera angle when someone crouches in my game, what I mean is, when someone pushes the c button it makes them crouch (that works) and when they let it go they uncrouch (that works). So All I need help with is when they crouch it changes their camera angle to the HumanoidRootPart so it gives the effect that they are lower. So I was wondering how I could make the camera offset a little in front of the HumanoidRootPart. (this is an fps game) here is my script:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local Animate
local Humanoid = player.Character:FindFirstChildWhichIsA("Humanoid")
local char = player.Character or player.CharacterAdded:Wait()
local hrp = char:FindFirstChild("HumanoidRootPart")
local camera = workspace.CurrentCamera
mouse.KeyDown:Connect(function(Key)
if Key == "c" then
local Animation = Instance.new("Animation", player.Character)
Animation.AnimationId = "rbxassetid://6924820921"
Animate = Humanoid:LoadAnimation(Animation)
camera.CameraSubject = hrp
end
end)
mouse.KeyUp:Connect(function(Key)
if Key == "c" then
Animate:Stop()
camera.CameraSubject = Humanoid
end
end)