How to use catalog animations in game?

I want to use the animations that Roblox has created and sold on the catalog/avatar shop. I want to set them as the animation style for all players that join my game. I also want to use animations from different packages.

I don’t know how to get the IDs for the animations and I don’t know how to put them into the character because they don’t load when I try. If you are willing to help, can you guide me on how to script these animations into every player that joins the game and have it as their animation even after they die and respawn?

Example:
I want to use the knight animation for the running animation.

2 Likes

Grab the run animation’s catalog ID from that package and load it into your game.
Here’s a command line to do that:
game:GetService("InsertService"):LoadAsset("[CATALOG ID HERE]").Parent = workspace
It will load a Model with an animation nested inside. Save the .AnimationID or the whole animation.
Now, you should be able to follow one of the many solutions on dev forums about how to replace the default animations using the Animate local script.

2 Likes

How would I get the id for an individual animation (such as the running animation) from a package because, when I use the id ‘68’ for the knight animation package, it shows an error?

1 Like

Check its “Included Items” list. Then you’d get the individual animations:
Knight Run - Roblox
Now use that command line with the catalog ID ‘734325948’ to get the Knight Run

I got the animation into the character but the ‘animate’ script under the character is having a hard time with it. It shows up with a bunch of errors and the animation eventually breaks. Do you know how to avoid this?

When you edit the Animate script, are you making sure to leave the names of everything parented to Animate the way they were? If it’s nil it sounds like it’s lost a reference somewhere. Ideally you only change the numbers in the .AnimationID to the new ones in both the heirarchy of the script and within with its table of animations.

This is the script I used:

game.Players.PlayerAdded:Connect(function(plr)
	if plr then
		repeat wait() until plr.Character
		plr.Character.Animate.run.RunAnim.AnimationId = 657564596
	end
end)

I am just replacing the id.

As weird as it sounds, manually setting the ID of something using assetservice within a script doesn’t prepend it with the URL it should, like it does when you set it in Studio’s explorer. Try instead:
plr.Character.Animate.run.RunAnim.AnimationId = "http://www.roblox.com/asset/?id=" .. 657564596

2 Likes

Might be worth using the rbxassetid ContentId format.

rbxassetid://657564596

1 Like

Hi, it’s been a long time since anyone last talked on here, but I’m having a similar but slightly different dilemma. Instead of having the catalog animation play for the player, I want it to play for an NPC. Does anyone know how one would do this?

Use the solution to this thread and put the animation on the NPC model rather than the player model.

I made a rig that has an animation script attached to it. Now it’s up to you to find the ID for the animation you desire.

https://create.roblox.com/store/asset/18100214804/Animation-Rig

1 Like

Sorry, for bumping this post. I keep getting this strange error message, even though the animation clip is from roblox?

Failed to load animation with sanitized ID rbxassetid://892267099: AnimationClip loaded is not valid.

#EDIT: Roblox catalogue animations must be purchased or owned before use in-game.

local currentAnimTrack = nil
local currentAnimKeyframeHandler = nil
local currentAnimSpeed = 1.0

local runAnimTrack = nil
local runAnimKeyframeHandler = nil

local PreloadedAnims = {}

local animTable = {}
local animNames = { 
	idle = 	{	
		{ id = "http://www.roblox.com/asset/?id=892267099", weight = 1 },
		{ id = "http://www.roblox.com/asset/?id=892267099", weight = 1 },
		{ id = "http://www.roblox.com/asset/?id=892267099", weight = 9 }
	}

Hey, what if the animation from roblox is being played by on a NPC, do i need to still purchases it?

I’m not sure. Try using the asset above and testing it with an roblox catalog animation you don’t own.

Also don’t quote me on this, I’m new to roblox development.

You do not need to own it but the id from the store link may be different than the animation link. I use the extension BTRoblox and it gives you the object that has the animation attached and you can copy the link from there. You don’t want the product id but the animation id.

1 Like