I’m trying to modify the camera orientation when a player respawns.
I placed a LocalScript inside StarterCharacterScripts, so it runs automatically after the player respawns. The script is supposed to rotate the camera to (0, -90, 0) on the world axis, but for some reason, it doesn’t work.
I did what you suggested and added task.wait(0.2) at the beginning of my script. Now it looks like this:
task.wait(0.2) -- Waits 0.2 Seconds before the Camera changes.
local currentCam = workspace.CurrentCamera
currentCam.CFrame = CFrame.new(currentCam.CFrame.Position) * CFrame.Angles(0, math.rad(-90), 0)
It works now! Looks like the issue was the camera not being fully initialized.
No worries! Just keep this in mind that it takes a few milliseconds for the camera to properly initialize. Around 2-4 frames but I recommended 0.2 seconds just to be on the safe side.
Yes, you can but literally doing that is a bit too inefficient. A better thing to do is just to add a task.wait(0.1) which is roughly 6 frames would work as well.
Adding 4 RunService just won’t look good for any on-lookers and may raise eyebrows as it’s not the norm.