I want to make a FPS game but I am just a beginner programmer and don’t know how to lock a player in first person mode and then make it so that they are no longer in first person mode in intermission. I also don’t want to copy a YouTubers work. On a side note, the developer hub is very confusing to me so I don’t use it and I can’t find a tutorial on the developer forum to help me so if you know a developer forum tutorial that is easy to change to my liking please send me a link. And would this be a local script and where would I put the script?
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
StarterCharacter has a property called SetCameraType, I think that’s how it’s called. You can set it to FirstPerson and it will spawn you like that on default.
There is an option in (i believe) starterplayers properties. You can also script it manually with something like this
--below establish the variables
local FirstPersonCamera = game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
local RegularCamera = game.Players.LocalPlayer.CameraMode = Enum.CameraMode.Classic
--below do your script to change between the two
This would also be a local script in localplayerscripts. The reason for this is because the Client-Server Model which in laymans terms is communication between you (the client) and the game world(the server) This concept is extremely crucial for one who is going into development and especially when you try to tackle the programming of a weapon.
Also not to rain on your parade, but creating an FPS as a beginner is an extremely tough project to handle. Even teams of experienced developers fail to create an FPS well. I would recommend that you handle a smaller project as going for such big projects can overwhelm you and have different techniques of approaching it. From your question, i can tell that you dont understand very many crucial concepts to game development in roblox in general. Developer Hub is an extremely helpful tool for any developer on roblox. It explains lots of different things that are hard to find or explain in a youtube video or developer forum. what i would suggest you do is do a few small projects so you can get a grasp on scripting and being able to find solutions for problems like this on the developer hub, so when you do try to start making an FPS, you can solve these problems in a few minutes compared to asking the devforum. I wish you luck on your game development journey
Select StarterPlayer, change the property “CameraMode” to “LockFirstPerson”