I was looking at the fps guide on here, but my gun doesnt show up. I dont know if the gun isnt attached or what.

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

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

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);

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

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

local joint = Instance.new("Motor6D");
joint.C0 = CFrame.new(1, -1.5, -2); -- what I found fit best
joint.Part0 = viewModel.Head;
joint.Part1 = weapon.Handle;
joint.Parent = viewModel.Head;

4 comments

0

I wish I could explain more but I made the rig, the viewModel is in repstorage, idek

0

and what the actual hell is a viewmodel...

0

look in the first step to an fps guide on here

0

its basically fake arms for when in first person