First off, get two arms, long ass meshes, get whatever weapon you want, and make a part to indicate the camera, and rig the model, set the primary part of the model to the camera.
After that, make an idle animations thats repeating.
Then, every render stepped, put the primary part of that model to the camera.
local viewmodel = --PATH
viewmodel.Parent = workspace.Camera
local runservice = game:GetService("RunService")
local camera = workspace.CurrentCamera
runservice.RenderStepped:Connect(function()
viewmodel.Camera.CFrame = camera.CFrame
end)
Boom, you got the basics done,
Now animations:
Let’s start with bobbing, we will be using sin and cos waves for those
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local hum = character:WaitForChild("Humanoid")
local viewmodel = --PATH
viewmodel.Parent = workspace.Camera
local runservice = game:GetService("RunService")
local camera = workspace.CurrentCamera
local bobCF = CFrame.new()
locla running = 0
runservice.RenderStepped:Connect(function()
if hum.MoveDirection.Magnitude > 0 then running = 1 else running = 0 end --Checks if the player is walking or not.
local bobX = math.cos(tick() * 5 * hum.WalkSpeed/16) * .2 --Numbers inside () make the speed, and the .2 is the intensity, for both the Y and X
local bobY = math.abs(math.sin(tick() * 6 * hum.WalkSpeed/16) * .3)
bobCF = bobCF:Lerp(CFrame.new(bobX * running,bobY * running,0), .4) --Makes it smooth
viewmodel.Camera.CFrame = camera.CFrame * bobCF --Boom
end)
Now time to make a camera sway:
We need the mouse delta for this, let’s use UserInputService:
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local hum = character:WaitForChild("Humanoid")
local viewmodel = --PATH
viewmodel.Parent = workspace.Camera
local uis = game:GetService("UserInputService")
local runservice = game:GetService("RunService")
local camera = workspace.CurrentCamera
local bobCF = CFrame.new()
local swayCF = CFrame.new()
locla running = 0
runservice.RenderStepped:Connect(function()
local mouseDelta = uis:GetMouseDelta()/50 -- devide it by how much u want
if hum.MoveDirection.Magnitude > 0 then running = 1 else running = 0 end --Checks if the player is walking or not.
local swayX = math.clamp(mouseDelta.X, -0.2,0.2) --We clamp so that we dont get janky results
local swayY = math.clamp(mouseDelta.Y, -0.2,0.2)
local bobX = math.cos(tick() * 5 * hum.WalkSpeed/16) * .2 --Numbers inside () make the speed, and the .2 is the intensity, for both the Y and X
local bobY = math.abs(math.sin(tick() * 6 * hum.WalkSpeed/16) * .3)
bobCF = bobCF:Lerp(CFrame.new(bobX * running,bobY * running,0) , .4) --Makes it smooth
swayCF = swayCF:Lerp(CFrame.new(swayX, swayY, 0), .3)
viewmodel.Camera.CFrame = camera.CFrame * bobCF * swayCF --Boom
end)
answering your questions, personally, i make the viewmodels, add the shirts, and color the arms to be the same as the character’s arm skin color, and make sure all the bodyparts are invisible in first person