Hello. I’ve been struggling with making my camera face the player as of late. Note: All code works, the positioning is just off.
camera.CameraSubject = game.Workspace
camera.CameraType = "Scriptable"
camera.CFrame = CFrame.new(0,100,0)
menuGUI.Enabled = true
newGameButton.Activated:Connect(function()
menuGUI.Enabled = false
local CCE = Instance.new("ColorCorrectionEffect")
CCE.Parent = camera
local fadeTweenInfo = TweenInfo.new(3,Enum.EasingStyle.Linear, Enum.EasingDirection.Out,0,false,0)
local fadeTweenGoal = {TintColor = Color3.new(0,0,0)}
local playFadeTween = tweenService:Create(CCE, fadeTweenInfo, fadeTweenGoal)
local unfadeTweenInfo = TweenInfo.new(3,Enum.EasingStyle.Linear, Enum.EasingDirection.Out,0,false,0)
local unfadeTweenGoal = {TintColor = Color3.new(1,1,1)}
local playUnfadeTween = tweenService:Create(CCE, unfadeTweenInfo, unfadeTweenGoal)
-- Player screen fades to Black. Once done, teleports the player before setting the camera to look at the player.
playFadeTween:Play()
playFadeTween.Completed:Connect(function()
local playerCoords = game.ReplicatedStorage.Remotes.newGameTeleport:InvokeServer()
camera.CFrame = CFrame.new() --Need help here.
playUnfadeTween:Play()
end)
end)