Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make every player's camera face a certain direction?

In my game, when players are teleported to a level, their cameras don't face forward, so there comes times where they are completely turned around when the level begins. I simply want to turn everyone's camera to a certain coordinate, (0,90,0) for example. I understand that there was an update for ROBLOX studio that rearranged the contents in 'Player', so I would like an up to date solution for this problem.

1 comment

0

CFrame(position Vector3, look at Vector3) is all you need to make a CFrame at a position looking towards the other vector position

1 answer

I figured it out. The trick is to give every player a local script that turns their camera. I used an "in pairs" for loop to cycle through every player currently in the game and copy the local script into their character scripts, like so (the local script is named 'Turn'):

--this code goes in a normal script. for i,v in pairs (game.Players:GetChildren()) do script.Turn:Clone().Parent = v.character wait() end

Once the players have the local script, it will turn their cameras immediately. 'Turn' holds this simple code:

workspace.CurrentCamera.CFrame = CFrame.Angles(0,90,0)

This discussion is preserved as it was. New answers, comments, and votes are closed.