First person Script is not working

  1. What do you want to achieve? im trying to make a realistic walking system with three scripts, one for head bobbing, one for sprinting, and one for making it first person.

  2. What is the issue? When all of them are enabled and i test play, i am completely unable to move.

  3. What solutions have you tried so far? i have figured out that its something wrong with the first person script and i have tried manually turning on LockFirstPerson but it does the same thing.

this is the first person script that im using

local playerService = game:GetService("Players")

playerService.PlayerAdded:Connect(function (plr)
	plr.CharacterAdded:wait()
	plr.CameraMode = Enum.CameraMode.LockFirstPerson
end)

is there another way to turn on first person that allows the player to move around?

Go to StarterPlayerServices > CameraMaxZoomDistance and put it at 0.5

1 Like

Just put this line of code in a LocalScript inside of StarterPlayerScripts:

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

If this is a LocalScript then this should work: (not sure)

local Player = game.Players.LocalPlayer
repeat wait() until Player:HasAppearanceLoaded()
Player.CameraMode = Enum.CameraMode.LockFirstPerson -- or Player.CameraMode = "LockFirstPerson"

If this is a script then; sorry, I cannot help you. :sad:
Hope this helps. :happy1:

Edit: The LocalScript can be anywhere, for example:
StarterPlayerScripts or StarterGui.

Second Edit: Since you’re trying to make a realistic walking system; you might aswell just put all of those 3 scripts into one and put the LocalScript into StarterPlayerScripts :happy1:

1 Like

All of these solutions only work the first time i test it. if i stop testing it, then later i try again, it doesnt work. Im starting to wonder if there’s something wrong with Roblox studio because I have tried so many different scripts and they all do the same thing :face_with_diagonal_mouth:

edit: it seems to work on roblox, but not studio. im going to have to figure out what is happening and why i cant test it. thank you all for trying!

Have you tried StarterPlayer and go to Category Camera and set the MaxCameraZoomDistance to 0.5?

Or you can change the CameraMode ‘Classic’ to ‘LockFirstPerson’

That is a way to turn on first person without scripts.

image

1 Like

yes i already tried that, thank you!

i found the solution, i have to left click in order to use the keyboard. im not sure why but it works lol

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.