The animation I’m doing is for a sword and it’s already finished and uploaded to Roblox.
When I trigger the tool the animation doesn’t work.
The owner of the animation is a group and the game is in that same group.
The animation is in Action.
I have already uploaded it several times and try to do it from different games.
I guess it loaded correctly to roblox since the preview appears.
I tried with a default roblox animation and it worked correctly.
Any suggestion is very welcome
- Sword File:
- Script:
local Tool = script.Parent
Tool.Activated:Connect(function()
local Character = Tool.Parent
local Hum = Character:FindFirstChildWhichIsA("Humanoid")
local Animator =Hum:WaitForChild("Animator")
if Character and Hum then
local Anim = Tool.Animation
local Track = Animator:LoadAnimation(Anim)
Track:Play()
print("Should work?")
end
end)
-- put this on localscript --
local ToolName = script.Parent
local Anim = ToolName:WaitForChild("Animation")
local TrackAnim
ToolName.Activated:Connect:(function()
local players = game.Players.LocalPlayer
local Character = players.Character
local Human = Character:WaitForChild("Humanoid")
if TrackAnim then
TrackAnim = Human:LoadAnimation(Anim)
TrackAnim:Play()
end
end)
The fact that your script worked correctly with a default roblox animation tells me that your script is probably not the problem.
If the only change that was made before it went from not working to working was the animation used, then the animation itself is the problem, not the script.
Also, you mentioned that you tried to use the animation from different games. Were these different games owned by the group, or were they owned by you?
First, I uploaded the animation with the group and tried a group game, it didn’t work.
Then I tried the same animation on another game in the group to rule out that it was the game, it didn’t work either.
Then I re-uploaded the animation to my account and tried it on a game of mine, it didn’t work either.
As far as I know the animation is not corrupted or anything like that (I did it with Moon Animator), I only have one possibility in mind, that the game is blocking the animation somehow.
It happened before with the AnimationWeightBlendedFix but that option is now dismantled.