I’m making a sword animation, and I put a motor6D inside the right arm of the dummy, and then connected to the right arm and the handle.
After I animated the sword and exported to roblox and I put it in my tool, it doesn’t work as I expected.
Issue: robloxapp-20200518-1942492
How it should be: robloxapp-20200518-1944471
I tried a script that makes a motor6D that connects the handle to the rightarm, but still didn’t work.
No, he’s trying to use Roblox’s animation system to animate the grip, he doesn’t want to use the Tool’s Grip property, which forces the RightGrip to be a Weld instead of a Motor6D.
Yeah, but the sword is literally sticked to the hand bottom.
I wan’t to know how to get the animation to work in the tool also, so I can make better stuff in the future.
Here’s a script that you can use to make the grip animated.
Put it inside of the Tool and see if it works out.
local tool = script.Parent
local handle = tool.Handle
local function onEquipped()
local character = tool.Parent
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
if not humanoid then
return
end
local rigType = humanoid.RigType
local targetLimb
if rigType.Name == "R15" then
targetLimb = "RightHand"
else
targetLimb = "Right Arm"
end
local limb = character:FindFirstChild(targetLimb)
local rightGrip = limb and limb:WaitForChild("RightGrip", 2)
if not rightGrip then
return
end
local newGrip = Instance.new("Motor6D")
newGrip.Name = "RightGrip"
newGrip.Part0 = limb
newGrip.Part1 = handle
newGrip.C0 = rightGrip.C0
newGrip.C1 = rightGrip.C1
newGrip.Parent = handle
rightGrip:Destroy()
end
local function onUnequipped()
if handle:FindFirstChild("RightGrip") then
handle.RightGrip:Destroy()
end
end
tool.Equipped:Connect(onEquipped)
tool.Unequipped:Connect(onUnequipped)
What I think is, feel like the animation doesn’t play because you need to replace the toolgrip weld with a motor6d, if it still doesn’t work after, you might have to try inserting the handle of the tool inside a model, inside the player.
Could be wrong but don’t think you can animate parts that are parented under a tool object, must be parented under a part or model object with motor6d.