Hi, so I’ve scaled characters in my game to be much smaller, however the issue is that for whatever reason the camera seems to be slightly above the character at this size. Can you help?
The script I use:
local cameraHeightOffset = 0
local fieldOfView = 70
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local Humanoid = Character:WaitForChild(‘Humanoid’)
-- Adjust player's size
for i, Child in pairs(Humanoid:GetChildren()) do
if Child.Name == 'BodyDepthScale' then
Child.Value = 0.1
elseif Child.Name == 'HeadScale' then
Child.Value = 0.1
elseif Child.Name == 'BodyHeightScale' then
Child.Value = 0.1
elseif Child.Name == 'BodyWidthScale' then
Child.Value = 0.1
end
end
-- Create a custom camera rig
local cameraRig = Instance.new("Camera")
cameraRig.Name = "CustomCamera"
-- Calculate the camera's position based on the character's proportions and control variables
local headPart = Character:WaitForChild("Head")
local headPosition = headPart.Position
local characterSize = Character:GetExtentsSize()
local cameraHeight = characterSize.y / 0.1 - cameraHeightOffset
cameraRig.CFrame = CFrame.new(headPosition - Vector3.new(0, cameraHeight, 0))
-- Set the camera's field of view based on the control variable
cameraRig.FieldOfView = fieldOfView
-- Set the Workspace's CurrentCamera to the custom camera rig
game.Workspace.CurrentCamera = cameraRig
end)
end)