Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Having a players arms follow the mouse while also playing animations?

Asked by
Abandion 118
4 years ago

I have a script that orients the head to the player's mouse and welds the arms to the head, as well as animations for a gun. Animations work fine when I disable the welding function, but do not work when it is active. Is there any way around this?

script.Parent:WaitForChild("weldevent").OnServerEvent:Connect(function(plr, target, origin, c1)
        plr.Character.Torso.Neck.C1 = CFrame.new() 
        plr.Character.Torso.Neck.C0 = CFrame.new(0, 1.5, 0) * CFrame.Angles(math.asin((target - origin).unit.y), 0, 0)
end)

torso.Neck is a Motor6d object and weldevent fires whenever a player moves their mouse. A seperate function changes Part0 of left shoulder and right shoulder to the head.

1 answer

Log in to vote
1
Answered by
Abandion 118
4 years ago

Nevermind, I had the right solution to begin with. Use TweenService if you're looking to get this effect.

Ad

Answer this question