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

How do i keep a characters arm still when moving (like when holding a tool)?

I am working on a gun system for my game, but so far i cant figure out how to keep the right upper arm from moving. Whenever i jump the arm flies in the air and ruins the guns aim, and when im walking the gun sways back and forth, so it also ruins aim badly.\

So far i tried welding the right upper arm to the HumanoidRootPart, but the arm still moves a little bit, and it just looks weird when jumping.

If you can help out please do! Thanks!

This is what i have so far:

local rs = p.Character.RightUpperArm:WaitForChild("RightShoulder")
rs.C0 = CFrame.new(1.5,.25,-.5)
rs.C1 = CFrame.Angles(math.rad(-80),0,0)
local gun = game.ReplicatedStorage.Pistol:Clone()
gun.Parent = p.Character
gun.CFrame = p.Character.RightHand.CFrame
local weld = Instance.new("Weld", gun)
weld.Part0 = gun
weld.Part1 = p.Character.RightHand
weld.C0 = CFrame.new(0,-.45,-.45)*CFrame.Angles(math.pi*1.5,math.pi,0)	
local weld2 = Instance.new("Weld", gun)
weld2.Part0 = p.Character.RightUpperArm
weld2.Part1 = p.Character.HumanoidRootPart
weld2.C0 = CFrame.new(-1.5,.25,1)*CFrame.Angles(math.rad(-70),0,0)

1 comment

0

For now i am disabling animations to make it more smooth

1 answer

make an animation for it that plays during the walking and idle animation where the right arms stays still. you can easily do this by reading this article on the wiki about animating, and this article on the wiki about changing default animations

2 comments

0

I know how to animate and stuff lol, i was just looking for an easier way of doing it than that :P Thanks tho

0

did this solution work?

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