Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make arms and gun show in first person?

Source I tried to use: https://scriptinghelpers.org/guides/the-first-person-element-of-a-first-person-shooter

So I have been trying to make a first person shooter and cant seem to understand how to make arms and gun appear like in Call Of Duty by attaching a rig into the camera. Are there any videos, links, ect. on how I could do this?

Script I tried to use to do this.

local camera = game.Workspace.CurrentCamera;
local humanoid = game.Players.LocalPlayer.CharacterAdded:Wait():WaitForChild("Humanoid");

local repWeapon = game.ReplicatedStorage:WaitForChild("Gun");

local weapon = repWeapon:Clone();
local viewModel = game.ReplicatedStorage:WaitForChild("viewModel"):Clone();

weapon.Parent = viewModel;
viewModel.Parent = camera;

local joint = Instance.new("Motor6D");
joint.C0 = CFrame.new(1, -1, -1);
joint.Part0 = viewModel.Head;
joint.Part1 = weapon.Handle;
joint.Parent = viewModel.Head;

print("Done!")

local function onDied()
    viewModel.Parent = nil;
end

local function onUpdate(dt)
    viewModel.Head.CFrame = camera.CFrame;
end

humanoid.Died:Connect(onDied);
game:GetService("RunService").RenderStepped:Connect(onUpdate);

2 comments

0

well the thing looks fine

0

ok but I cant seem to be able to put the gun into the camera

1 answer

this is very complicated and probably too hard for your skill level for now just abandon this project your working on. this is probably not the answer your looking for but im being completely honest.

This discussion is preserved as it was. New answers, comments, and votes are closed.