repeat wait() until script.Parent.Parent
repeat wait() until script.Parent.Parent.Character
player = script.Parent.Parent
char = player.Character
camera = workspace.CurrentCamera
local IsStanding = true
local IsCrouching = false
local IsProne = false
game:GetService("RunService").RenderStepped:Connect(function()
if IsStanding then
camera.CFrame = camera.CFrame + Vector3.new(0,(char.Head.Position.y-4.8),0)
elseif IsCrouching then
camera.CFrame = camera.CFrame + Vector3.new(0,(char.Head.Position.y-6),0)
elseif IsProne then
camera.CFrame = camera.CFrame + Vector3.new(0,(char.Head.Position.y-7.8),0)
end
end)
This code does work (bit basic) although you do have to have a bit of code that changes the bool values.
--you may have to change them all to -4.8 since it is using char.Head.Position.y
The code needs to be local script and should be a decendent (child/be in) StarterPlayerScripts which is found in StarterPlayer.
2 comments
This is the same problem my current script has encountered.
Did you copy ot exactly and put the local script in the right place because it works when I tested it