Making a Death Animation? (like Arsenal)

Hello me again

How do i make a Death Animation when you die? Like Arsenal? And can be purchased too?

3 Likes

Spawn a dummy R6/R15 rig and animate away. Publish the finished animation somewhere, grabbing the AssetID. Insert an Animation (object class) into ServerStorage somewhere, pasting the AssetID in. Now you can reference that animation to create a playable AnimationTrack somewhere in your scripts.

Listen on the server for when a player is despawning. So that they don’t have to wait out the animation to respawn, spawn a clone of their humanoid where they died, animating that instead. Load the animation on the server so it replicates to all the clients, play it, and whenever it’s finished, delete the cloned humanoid.

Many of arsenals’ animations include a little more scripting for visual effects and sound. If I had to guess, instead of cloning the humanoid directly, all the animations are models containing a server-sided script along with a blank humanoid and any sound/mesh assets needed, copying it into workspace and applying the players’ HumanoidDescription onto the blank clone, then turning on the script.

If you’ve already a money script handling datastores and player inventory, simply add a table to their save data indicating they own/have equipped the death animation. Something like:

data = {
--[...]
  deathAnimations = {
    "BigExplosion",
    "BiggerExplosion",
    "BiggestExplosion"
  },
--[...]
}

When a player joins, find the dictionary data pertaining to those string values representing the animations they own, and let them pick from it in some way. Say that now makes a table holding an active players’ data somewhere read:

local player_X = {
--[...]
  activeDeathAnimation = "BiggestExplosion",
--[...]
}

Once they get a kill, reference player_X.activeDeathAnimation to return “BiggestExplosion”, find the model that is linked to in ServerStorage and clone/play animations as designed

5 Likes

Is it easier to just to play the death animation when target humanoid (from Humanoid:TakeDamage of course) reaches < 0 health?

1 Like

this kind of explains some of the aspects behind the mechanism and process of the script and disabling your character from initially disconnecting into a literal lego debris so yeah

1 Like

If the humanoid dies it will be handled internally (falling apart) making it an unsafe reference in code, as you might reference something that’s being parented to nil as the player respawns. You could prevent the player from actually dying, say, only allow them to take damage to 1 hp, then ‘kill’ them with code after playing the animation upon reaching that health.
But, for visual clarity and the player being able to respawn quicker, it may be cleaner to spawn a dummy in their place and allow them to respawn naturally. OP mentioned Arsenal, which to my knowledge, you can die and still see your ragdoll where you died – being another benefit of the clone model, as the character would have to disappear for the player to respawn otherwise.

3 Likes