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
well the thing looks fine
ok but I cant seem to be able to put the gun into the camera