Hello beginner, amutar, or pro roblox programmers! This is a very basic and simple First Person tutorial for your amazing future roblox projects. I would first recommend Are your ready? Let's begin!
Ok, so first your going to want to make a new game.
I would recommend the regular Baseplate but other options are fine too.
After that you are going to want to make sure that you have your explorer open. If you can't find your explorer then you are going to want to navigate to the top of your screen, click veiw, then click explorer. After that you should have your explorer open.
Your going to want to navigate over to your StarterPlayer folder and expand it (click the arrow pointing right)
If you don't have StarterCharacterScripts inside the StarterPlayer folder or you can't expand the StarterPlayer folder or if you don't even see the folder at all, then you have probobly deleted something on accident. Don't worry! Just make a brand new game. This time it should have the StarterPlayer folder and it's 2 decendents (The two folders inside of StarterPlayer). I personally never had this experience but I still included this just in case, although it may be pretty rare for someone to do this.
After that hover your mouse over StarterCharacterScripts and press the plus sign. In there, search LocalScript, then click on LocalScript
A LocalScript is a script that runs from the player's client. Anything from a client can only be run or seen by the player. Anything from a server can be run and seen by everyone.
When you enter your script, clear everything by press CTRL+A on windows or CMND+A on mac, then press delete or backspace on your keyboard. After that, type or copy the following code.
local player = game.Players.LocalPlayer
player.CameraMaxZoomDistance = 0.5
Keep reading if you want an explanation on the code
Ok thanks for sticking by. So first let me explain the variable, player
local player = game.Players.LocalPlayer
Game means everything inside of the explorer like workspace. (Everything below is a game)
Players means the players inside of the game
(Your going to have to run the game in order to see the player inside of Players)
LocalPlayer means the Player who is running from the client
Next up is
player.CameraMaxZoomDistance = 0.5
This one is very simple. Since our variable player holds the value game.Players.LocalPlayer, we can access it's properties. I will not explain how to access the properties I display but feel free to search up a tutorial on properties to get a better understanding on it. I recommend it a thousand.
The CameraMaxZoomDistance property is the max you can zoom out. The CameraMinZoomDistance is the minimum you can zoom out. CameraMinZoomDistance is by deafult set to 0.5, AKA First Person. CameraMaxZoomDistance is by defult set to 128. We do not want that. We want the player to stay zoomed in to first person. So we are setting CameraMaxZoomDistance to the lowest value it can be, 0.5. This will change our player camera to be locked to first person
That is the most beginner friendly way to make a First Person Script. If what you read was a little too overwelming, take breaks between each image to fully take in that information or just come back at a later date. Thank you for reading, and have a fantastic Day.
Bye!!!!!