How do i make a first person view

Hello, im at my phone right now, so if you see something wrong in my text, im sorry*

Hello, i want to create first person shooter to have fun with my friends together.

I do not know how do i add hands, pistol model and more. Like a arsenal and other first person shooters
But i tried to create script like this

LocalScript:

Camera = Workspace.CurrentCamera
while wait() do
Workspace.HandsPart.CFrame = Camera.CFrame
end

And weld hands to the camera, and disable collision
But it was very laggy causing alot of bugs

I might be ask for script that can help alot and make do not be so laggy as before. Thanks!

1 Like

You have some good tutorials on YouTube, check this one: CREATE YOUR OWN FPS GAME ON ROBLOX (FE Gun Kit Viewmodel)

Sorry, but i haven’t used free models for along time, and im very afraid of viruses. Could you can send just code instead? (Or just familiar Suggest in a DevForum) Just i want to learn and make games, not like just using free models that 20% can have viruses

In the StarterPlayer object you can set the CameraMaxZoom to the same as CameraMinZoom which is 0.5 which will force the camera into First person and the players wont be able to zoom out.

3 Likes
local players = game:GetService("Players")
local player = players.LocalPlayer
player.CameraMode = Enum.CameraMode.LockFirstPerson
1 Like

Create a new Model or use the one you currently have (Make sure to name it “FPS”), After this, You’re gonna need to create 2 Parts, One named “CameraBone” and the other one “HumanoidRootPart”, After you do this, Make sure to make both Parts invisible, Anchored and non-collidable (CanCollide = false)

Doing that, You are gonna create 2 Arms, The right and the left one, Make sure that they’re facing the same direction as the CameraBone. Then we’re gonna go into the Welding part:

  1. Create a Motor6D inside CameraBone - Make it’s Part0 CameraBone and Part1 HumanoidRootPart

  2. Create a Motor6D inside HumanoidRootPart - Name it “LeftArm” and make it’s Part0 the HumanoidRootPart and the Part1 the LeftArm

  3. Create a Motor6D inside the HumanoidRootPart again - Name it “RightArm” and make it’s Part0 the HumanoidRootPart and the Part1 the RightArm

After you do this, Click on your model, Find the “PrimaryPart” inside the Model’s Properties and make it the HumanoidRootPart.

After all that, Create a new LocalScript inside StarterPlayerScripts (StarterPlayer > StarterPlayerScripts) and name it “FPSController”, Put the FPS Model inside of it, And then paste this code inside the script (Make sure to remove anything inside the Script before doing so):

-- Variables
local RunService = game:GetService("RunService")
local RenderConnection = nil

-- Initializing Model - Get the model and parent it to the Camera
local ViewportModel = script:WaitForChild("FPS")
ViewportModel.Name = "LocalViewportModel"
ViewportModel.Parent = workspace.Camera

-- Rendering:
RenderConnection = RunService.RenderStepped:Connect(function()
	-- Make sure the Model exists
	if ViewportModel then
		-- Set the Model's CFrame to the Camera CFrame
		ViewportModel:SetPrimaryPartCFrame(workspace.Camera.CFrame)
	end
end)

You can also change the Camera Distance inside StarterPlayer to 0.5 (Min and Max) So it will be on First Person by default. If you want to know more about how to create your own FPS Arms/Framework, Take a look at this.

3 Likes

Hmmm, that looks very useful. Im busy right now, and i can’t test it yet, if that works, i will choose this as solution. Have a great day!

This is a YouTube video, not a freemodel… you can also check the codes for virus