I was just wondering how I could make the camera of my character follow the character’s head when I press the crouch button. I’ve tried different methods such as camera.CameraSubject = head. This does work except that this would happen
. This is my current codelocal uis = game:GetService(“UserInputService”)
local char = script.Parent
local hum = char:WaitForChild(“Humanoid”)
local isCrouching = false
local animation = hum:LoadAnimation(script:WaitForChild(“Animation”))
local HipHeight = hum.HipHeight
uis.InputBegan:connect(function(key)
if key.KeyCode == Enum.KeyCode.LeftControl then
if not isCrouching then
isCrouching = true
animation:Play()
hum.WalkSpeed = 9
hum.JumpPower = 0
HipHeight = 1
else
HipHeight = -1
animation:Stop()
hum.WalkSpeed = 14
hum.JumpPower = 50
isCrouching = false
end
end
end)
I’ve tried messing around with hip height to see if that works, It didn’t