How i create smooth First Person Player Arm Movement

Hello,

I was wonder how to do I create smooth, and Cool FPS Player Arm Movement?
While this is here, how can I animate Weapons besides AnimationControllers?

Anything Helps.
Thanks.

1 Like

Im not entirely sure if this is possible, but I dont really mess with anything that I dont understand, so i wouldnt have any idea if it is or if it isnt.

Something I’ve done is to have arms, a camera location and the weapon in a model with a humanoid, animator and whatnot.


image
I then used the roblox animator to animate the weapon.

As for smooth movement, I would recommend snapping the Primary Parts position to the cameras position, and tweening the orientation.
This will give you something that looks good, and isnt too jittery and or lagging behind the cameras position.

Thanks, but i am mainly talking about Player Arms, not FPS Arms, sorry if i wasnt clear

Player arms can be cloned, and put into a viewmodel. I have made a system once before, that cloned the shirt and arm colors over to a viewmodel, but didnt transfer arm meshes over, as im not entirely sure how arm meshes are loaded into the character.

I Understand that, but im not talking about that, im talking about the Players Arms, like the actual Limb of the Player, Perferablly R6.I am also asking how to i make the Players Arms follow the Camera smoothly like with FPS Arms

Get a script to rotate them to face the camera, and then make them visible by using LocalTransparencyModifier running every frame.

Here is a script i modified to work only with R6, but it rotates the arms and head to face the cameras direction, and replicates to the server.

This isnt the best, and it sure as heck isnt smooth, but tweenservice might be able to fix it, or moving the server side part to the local side, but that would make it only client-sided.

Local Script (Parented to StarterCharacterScripts):

local RunService = game:GetService('RunService')
local Event = script:WaitForChild('LookEvent')
local Player = game.Players.LocalPlayer
local Camera = workspace:WaitForChild('Camera')
local Character = Player.Character or Player.CharacterAdded:Wait()
local Head = Character:WaitForChild('Head')
local Humanoid = Character:WaitForChild('Humanoid')
local RootPart = Character:WaitForChild('HumanoidRootPart')
local Torso = Character:WaitForChild('Torso')
local Neck = Torso:WaitForChild('Neck')

local Ang = CFrame.Angles
local aSin = math.asin
local aTan = math.atan

local NeckOrgnC0 = Neck.C0
local HeadHorFactor = 0
local HeadVertFactor = 1
local UpdateSpeed = 0.5

while task.wait(1/60) do
	local CameraCFrame = Camera.CoordinateFrame
	local MouseOriginPosition = Player:GetMouse().Origin.Position
	if Humanoid.Health > 0 then
		Event:FireServer(CameraCFrame, HeadHorFactor, HeadVertFactor, UpdateSpeed, MouseOriginPosition)
	end
end

Server Script (Parented to Local Script):

local Event = script.Parent:WaitForChild('LookEvent')
local Ang = CFrame.Angles
local aSin = math.asin
local aTan = math.atan

local Character = script.Parent.Parent
local Head = Character:WaitForChild('Head')
local LeftArm = Character:WaitForChild('Left Arm')
local RightArm = Character:WaitForChild('Right Arm')
local Humanoid = Character:WaitForChild('Humanoid')
local RootPart = Character:WaitForChild('HumanoidRootPart')
local Torso = Character:WaitForChild('Torso')
local Neck = Torso:WaitForChild('Neck')
local NeckOrgnC0 = Neck.C0
local RightShoulder = Torso:WaitForChild('Right Shoulder')
local RightShoulderOrgnC0 = RightShoulder.C1
local LeftShoulder = Torso:WaitForChild('Left Shoulder')
local LeftShoulderOrgnC0 = LeftShoulder.C1

Event.OnServerEvent:Connect(function(Player, CameraCFrame, HeadHorFactor, HeadVertFactor, UpdateSpeed, MouseOriginPosition)
	if Humanoid.Health > 0 then
		local Dist = (Head.CFrame.Position-CameraCFrame.Position).Magnitude
		local Diff = Head.CFrame.Y-CameraCFrame.Y
		
		local HeadPosition = Head.CFrame.Position
		
		local LeftArmPosition = LeftArm.CFrame.Position
		
		local RightArmPosition = RightArm.CFrame.Position
		
		local TorsoLookVector = RootPart.CFrame.lookVector
		
		
		local X = -(math.asin((MouseOriginPosition - CameraCFrame.Position).unit.y)) * -1
		
		--Neck.C0 = Neck.C0:Lerp(NeckOrgnC0*Ang(-(aSin(Diff/Dist)*HeadVertFactor), 0, -(((HeadPosition-MouseOriginPosition).Unit):Cross(TorsoLookVector)).Y*HeadHorFactor),UpdateSpeed/2)
		
		local _, Y, Z = Neck.C0:ToEulerAnglesXYZ()
		Neck.C0  = CFrame.new(Neck.C0.Position) * CFrame.Angles(X - 1.5, Y, Z)
		
		local _, Y, Z = RightShoulder.C0:ToEulerAnglesXYZ()
		local OldRightC0 = RightShoulder.C0
		RightShoulder.C0 = CFrame.new(RightShoulder.C0.Position) * CFrame.Angles(X, Y, Z)
		
		local _, Y, Z = LeftShoulder.C0:ToEulerAnglesXYZ()
		LeftShoulder.C0 = CFrame.new(LeftShoulder.C0.Position) * CFrame.Angles(X, Y, Z)
	end
end)

Edit: Here are some screenshots of what the code should do
image
image
image

4 Likes

Appears to follow Players Camera, but it has its own sets of issues, like how if you look at a certain Angle, the Arms just disappear.

Yeah, that would be a camera offset issue unfortunately, and i really dont know how to do math properly, so unfortunately i cant help you there.
The best you could do is to limit the rotation somehow, or do some crazy math to find out that to set the humanoids camera offset to.

@Chark_Proto
I appreciate the script but thats also not really what i want either. (Not to be ungratetful)

What i want specifically is this kind of behavior in First Person.(Used a Free Model for this, which is something that i dont like to do.):

Below is that it looks like in 3rd Person:

Weapon without Aiming:

Weapon While Aiming (Camera Zooms in, took this image before the one above):

Idk, not the best scripter nor am i the smartest.

Hi, Although this is a very old post, I’ll still mark this as the Solution.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.