Tool does not want to animate with R6 character

Hello guys, I have been trying to make this animation work for a while now and I do not know anymore please help :).

1. What am I trying to achieve : Animate the stick.

2. What have I tried? : Check videos on youtube on how to animate/create tools properly, checked the Roblox dev forums, checked on google for any external information outside of these said websites.

3. The issue : So basically I have a Stick I made in blender which is a .fbx file (don’t know if it matters or not) It works on my rig but not on my character I have tried making it play on click and also put it right in the animation folder in the idle category to see if it would work with no results.

This is the code where I make the weapon (Player_Connection_module under ServerScriptService.Player_Data_Handler)

local ServerScriptService = game:GetService("ServerScriptService")
local Weapon_Data = require(ServerScriptService.Weapon_Handler.Weapon_Data)
local Weapon_Module = require(ServerScriptService.Weapon_Handler.Weapon_Module)
local Player_Connection_Module = {}

-- Server players with ID. 
local playerNameToID = {}

-- Saves the users on join.
function Player_Connection_Module.onPlayerAdded(aPlayer)
    local lPlayerName = aPlayer.Name
    local lPlayerUID = aPlayer.UserId
        local lPlayerData = {
            lPlayerName,
            lPlayerUID
        }
    table.insert(playerNameToID, lPlayerData)
    -- Creates the First weapon for now.
    Weapon_Module.makeWeapon(aPlayer, "Stick")
    print(playerNameToID)
end

-- Removes the users on leave.
function Player_Connection_Module.onPlayerRemoved(aPlayer)
    local lPlayerName = aPlayer.Name
    local lPlayerUID = aPlayer.UserId
        local lPlayerData = {
            lPlayerName,
            lPlayerUID
        }
        local tableId = table.find(playerNameToID, lPlayerData)
        table.remove(playerNameToID, tableId)
        print(playerNameToID)
end


return Player_Connection_Module

This is the animation handler located at (ServerScriptService.Input_Handler.Animation_Handler)

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local lMotor6D = Instance.new("Motor6D", char["Right Arm"])
		lMotor6D.Name = "ToolGrip"
		
		char.ChildAdded:Connect(function(child)
			if child:IsA("Tool") and child:FindFirstChild("BodyAttach") then
				lMotor6D.Part0 = char["Right Arm"]
				lMotor6D.Part1 = child.BodyAttach
			end
		end)
	end)
end)

This is the tool equipping script to check which animation folder to use. located at (ReplicatedStorage.Weapon_Models.Stick.Tool.Animation_Switcher)

local Player = game.Players.LocalPlayer
repeat wait() until Player.Character
local Character = Player.Character or Player.CharacterAdded:Wait()
local humanoid = Character:WaitForChild("Humanoid")

tool = script.Parent.Parent.Tool

tool.Equipped:Connect(function()
	Character.Animate.Enabled = false
	Character.Stick_Animations.Enabled = true
end)

tool.Unequipped:Connect(function()
	Character.Animate.Enabled = true
	Character.Stick_Animations.Enabled = false
end)

File project browser included in thread.
Helpful thread but it does not work for me : How to animate Tool Parts (Guns, Knifes etc.)


FOLLOWING IMAGES ARE FROM IN STUDIO PLAY MODE

Even the rig does not animate in game.
projeccbrok

1 Like

Maybe the Animation is not R6 and R15?

1 Like

instead of

tool.Equipped:Connect(function()
	Character.Animate.Enabled = false
	Character.Stick_Animations.Enabled = true
end)

tool.Unequipped:Connect(function()
	Character.Animate.Enabled = true
	Character.Stick_Animations.Enabled = false
end)

you have to write like this

local animationtrack = Humanoid:LoadAnimation(--paste the directory of the animation here)

tool.Equipped:Connect(function()
	animationtrack:Play
end)

tool.Unequipped:Connect(function()
      animationtrack:Stop()
end)
1 Like

it ended up working thanks yall :slight_smile:

1 Like