Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How can I switch a player between first person and third person?

Asked by 8 years ago

Hello, in my place, I want to switch players to third person when they are in a lobby, and switch them to first person when they are in a match. I am having issues doing this. For some reason, I'm only able to switch to first person using this bit of code:

    game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson

in a local script this locks their fist person, I currently have this in the start gui. Now after I set this it seems I can't revert to third person when I use this:

        game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.Classic

The only way to go back to third person so far seems to be by killing them. I'd rather not kill the player to reset their camera since it seems un-professional .

How can I switch the player from first person to third person preferably without killing them or making it seem "sloppy"?

1 answer

Log in to vote
0
Answered by
1N0body 206 Moderation Voter
8 years ago
Edited 8 years ago

They need to scroll out.

It works only this way.

If you want to avoid it:

You'll have to change the 'CameraMinZoomDistance' at 'StarterPlayer'(game.StarterPlayer), and try setting it to 5. This will also 'force' the player not to be able to scroll into first person.

0
hmmmm, that kinda sucks, but it's not a big deal I'll test your answer. Dekadrachm 50 — 8y
0
Nice, haha that worked! I need to get out of first person so people could use my gui easier Dekadrachm 50 — 8y
Ad

Answer this question