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

How to make the right arm move when animating?

Asked by
Meqolo 78
6 years ago

So, I'm trying to make a shotgun tool, the animation plays fine, with the exception of the right arm. The right arm just stays in the same position as if the tool was being held normally. I have the animation priority set to action.

Code:

local Tool = script.Parent
local HoldAnim = Instance.new("Animation")
HoldAnim.AnimationId = "http//:www.roblox.com/Asset?ID=1463289747"
HoldAnim.Name = "ShotgunHoldAnimation"

wait(1)
local Motor = Instance.new("Motor6D",game.Players.LocalPlayer.Character["Right Arm"])
Motor.Name = "Main"
Motor.Part0 = game.Players.LocalPlayer.Character["Right Arm"]
Motor.Part1 = script.Parent.Main
local HoldTrackAnim = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(HoldAnim)
HoldTrackAnim.Priority = Enum.AnimationPriority.Action
local Equipped = Instance.new("BoolValue", script)

Tool.Parent.Equipped:Connect(function(Mouse)
    Equipped.Value = true
    HoldTrackAnim:Play()
end)

Tool.Parent.Unequipped:Connect(function()
    Equipped.Value = false
    HoldTrackAnim:Stop()
end)

The motor is created but shortly is deleted for an unknown reason.

Picture: https://imgur.com/a/9ZXNk

Answer this question