I’m trying to make my camera face my character’s humanoid root part from 20 studs away, but the script doesn’t work.
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local uis = game:GetService("UserInputService")
local camera = workspace.CurrentCamera
local event = game.ReplicatedStorage:WaitForChild("Event")
local ts = game:GetService("TweenService")
camera.CameraType = Enum.CameraType.Fixed
uis.InputBegan:Connect(function(input, gps)
if input.KeyCode == Enum.KeyCode.E and not gps then
print("uwu")
camera.CameraType = Enum.CameraType.Fixed
camera.CFrame = char.HumanoidRootPart.CFrame + char.HumanoidRootPart.CFrame.lookVector * 20
camera.CFrame = CFrame.new(camera.CFrame.Position, char.HumanoidRootPart.Position)
end
end)
The issue is, the camera will look somewhere else sometimes.