#Animation won't work

1 messages · Page 1 of 1 (latest)

vagrant hedge
#

I created this Death animation, then after many struggles managed to. Import it into Roblox Studio, Saved it, then for some reason, the animation didn't work anymore when I tried to put it back on a dummy, then I tried scripting it into replacing the death animation, but then my avatar would get stuck upward when I reset, doesn't respawn and doesn't play the animation either.
This is the Script I used:
``local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")

-- Stop default ragdoll
humanoid.BreakJointsOnDeath = false

-- Load your custom death animation
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://YOUR_ANIMATION_ID" -- Replace this!

local animator = humanoid:FindFirstChildOfClass("Animator") or humanoid:WaitForChild("Animator")
local deathTrack = animator:LoadAnimation(animation)

humanoid.Died:Connect(function()
-- Freeze character pose
for _, part in ipairs(character:GetDescendants()) do
if part:IsA("BasePart") then
part.Anchored = true
end
end

-- Play the death animation
deathTrack:Play()

-- Optional: unanchor after it's done (or reset)
task.delay(deathTrack.Length + 0.5, function()
    character:BreakJoints()
end)

end)``

#

Yes I did replace everything accordingly

#

No it still didn't work

mystic path
#

jus make the animation on roblox

vagrant hedge
#

Uh no?

#

I'm using blender for a reason

gusty zenith
vagrant hedge
gusty zenith
vagrant hedge
#

Yes

gusty zenith
#

but rather on how you handled it

vagrant hedge
#

I know 😔

gusty zenith
#

whenever a character dies, all of its limbs gets disconnected from eachother

vagrant hedge
#

I used the script to stop that tho

gusty zenith
vagrant hedge
#

Ah

#

But before I used the anchor script it didn't work either

gusty zenith
#

instead Disable their BreakJointsOnDeath on the humanoid property before they die

#

and you can also just anchor their HumanoidRootPart so they stay still(not really sure about this one)

#

and then play the animation

#

and after, break their joints (which you did optionally in the script.. By ai.. lmao)

gusty zenith
vagrant hedge
#

I'll try it tomorrow morning tyy

gusty zenith
#

✌️

#

np

vagrant hedge
#

@gusty zenith morning

#

Can you check my code

obsidian zodiac
#

you forgot an end

#
humanoid.Died:Connect(function()
    deathTrack:Play()
end)