The animation doesn't seem to work

My animation doesn’t work.

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.

  1. The owner of the animation is a group and the game is in that same group.
  2. The animation is in Action.
  3. I have already uploaded it several times and try to do it from different games.
  4. I guess it loaded correctly to roblox since the preview appears.
  5. I tried with a default roblox animation and it worked correctly.

Any suggestion is very welcome

- Sword File:

image

- 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)

- Animation:

I think that’s cause why animation doesn’t work

Try this

local Anim = Tool:WaitForChild("Animation")
1 Like

It didn’t work.
But still thanks for the suggestion :)*

-- 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)

I haven’t test yet but I’m sure it works fine

1 Like

I do not understand this, I think it will not be fulfilled since TrackAnim is nil

I also tried to modify the logic statement but it didn’t work anyway.

Edited:
I also thought you might have meant:

if Anim then

But it didn’t work anyway

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?

1 Like

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.

This is getting out of hand and slowing me down.

I found a solution, although I don’t know what specific thing I did to make it work.

  1. I modified the animation and exported it with the shortcut 5 of Moon Animator.
  2. When I exported it, I uploaded it to roblox overlaying the old animation.
  3. I tested it and it works perfectly

Thank you guys for your time :)*

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.