Purchased Animation Packs Overriding Custom Animations

Hi folks,

A user here recently pointed out a potential gaping hole in my game, which relies on custom animations 100% of the time. I am loading my animations via this simple script in ServerScriptService:

game.Players.PlayerAdded:Connect(function(plr)
   plr.CharacterAdded:Connect(function(char)
      char.Animate.run:WaitForChild("RunAnim").AnimationId = ("rbxassetid://5222223177")
      char.Animate.walk:WaitForChild("WalkAnim").AnimationId = ("rbxassetid://5222226338")
      char.Animate.jump.JumpAnim.AnimationId = ("rbxassetid://5222228941") 
      char.Animate.fall.FallAnim.AnimationId = ("rbxassetid://5222230339")
      char.Animate.idle.Animation1.AnimationId = ("rbxassetid://5222234785")
      char.Animate.idle.Animation2.AnimationId = ("rbxassetid://5222234785")
   end)
end)

The issue is that these are overridden by purchased animation packs like these:
image

I know there is an option in Studio to select Standard vs Player Choice for animations, but selecting ā€˜standardā€™ prevents my animations from loading and reverts everything back to the normal Roblox animations.
image

Iā€™ve looked into animation priorities, as it appears the purchased package is simply replacing the animations loaded in my script. I may be off base here. Clearly still much to learn. Appreciate any advice.

Its because the script inside Animate has the default animation ids, I would recommend joining the game and then copy the Animate script inside the player, you stop the test and paste it inside StarterCharacterScripts.

So you can change the things inside the script to your own IDs (Right at the start there are some IDs)

1 Like

Thank you for the lightning fast response. Is the suggestion that I changes these Idā€™s to my own?

Yes, you dont need to change anything else other than these ids. For safety, you can change these ids inside and the ids that are outside the script.

Which are these you wanted to change with your script. Have it in starter character scripts and it will run fine.

1 Like

Iā€™m guessing I also then select ā€œStandardā€ in the avatar animation settings rather than player choice?
Thank you again.

Actually you dont need to do that, it is to choose if they will use the purchased animation or the default.

Since its a custom animation then it doesnt matter

1 Like

Iā€™ve done some more testing on this and realized I likely didnā€™t explain my issue well. My goal is to permanently replace the run, walk, jump and idle animations with my own. I was previously accomplishing this with a local script that changed the animation IDs within the characterā€™s Animate script. (shown in my first post).

If I instead try the solution mentioned above: Making a copy of a clean Animate script and changing the IDā€™s in the script, I noticed that the animation Idā€™s values within the script do not change, so the character has default animations. Example using ā€˜jumpā€™ below. This is the clean script I copied into StarterCharacterScripts and adjusted with my desired animation 5222228981. Even when the game runs, the default animation (507765000) is played when the character jumps.


My original script corrects this by writing directly to the jump.JumpAnim.AnimationId value; however (finally my main problem):

When a custom Roblox animation package is selected like thisā€¦

ā€¦ the actual animation names inside of the values within the Animate script are changed, as are the IDā€™s. Here is after running the game with the Toy animation package selected:

782847020 is the Toy Jump animation, and Iā€™m not sure why they change the animation name from JumpAnim to ā€œ!ID!ā€, but this makes it tough for me to overwrite, as Iā€™m not sure how or what these custom packages will do to the Animate script. Iā€™m not sure if there is some way to prevent this script from being changed by the custom packages?

Appreciate any more advice.

So my workaround has been to delete anything that is somehow loaded into the char.Animate script and replace it with new animations with my IDs. I still donā€™t like it, as there should be a way to limit these packages, and the packages should not be renaming the animations. This is a Roblox made product that is changing the Animation from its standard name ā€œJumpAnimā€ to ā€œ!ID!ā€ - seems hacky.

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		char.Animate:WaitForChild("jump"):ClearAllChildren()
		local NewJumpAnim = Instance.new("Animation")
		NewJumpAnim.AnimationId = "rbxassetid://5222228981"
		NewJumpAnim.Parent = char.Animate.jump
		NewJumpAnim.Name = "JumpAnim"
	end)
end)