The PlayerAdded event can NOT be used for this. It will run on the server and you will find yourself doing more work on finding if someone has joined or respawned than doing it via LocalScripts.
Please note that you cannot use Scripts (running on the server) to manipulate your camera. The camera is only available on the client, thus, via a LocalScript.
It's really simple to check. You create a LocalScript in StarterPack / StarterGui and put in a code which checks if a certain value is present in the LocalPlayer
. If it is not, then you know that this is the first join. You can then create this value so new checks will find the value: the script will then know that this is a respawn and not a join.
01 | local Player = game.Players.LocalPlayer |
07 | if not Player:FindFirstChild( "HasJoined" ) then |
08 | Instance.new( "StringValue" , Player).Name = "HasJoined" |
The actual Camera manipulation will normally use CameraType Enum.CameraType.Scriptable
to do it's job. The only property relevant is then CoordinateFrame
, which represents the CFrame of the Camera. You can manipulate this CFrame to create smooth Camera operations.
After you are done, make sure that you undo your changes and change the CameraType back to Enum.CameraType.Custom
. You will then see your character again.
Locked by User#19524
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?