Changing Default Animations, is there an easy way to do it?

Currently, changing default animations is a pain in the butt. The only two reliable sources do not work, and that includes Roblox Wiki and a formally trusted script that doesn’t work under FE. As an animator I like to experiment and test out my animations through in-game situations, such as using a model for things like emotes and other animations. But through all of my experience , I’ve never been able to find a trust able script to change default animations, and so I am reaching out for help. I know i’m not the only one who is wondering how to do this, as I get this type of question a lot. Any help is appreciated, thank you!

16 Likes

When you press play solo in studio and spawn, there will be a localscript inside your character called Animate. Copy this script and stop the simulation, and paste it into StarterPlayer.StarterCharacterScripts to override the default animation script. You can then change the animation IDs inside the script and inside the script’s children to test your animations.

45 Likes

You can always just read humanoid states and walk speed and change animation weights, speeds, and play/stop them appropriately ater removing the Animate script and writing your own

2 Likes

Here is the basic version of the way I do it. (Server Script)

local NewAnimationID = 619543231

local function ChangeAnimation(character, animationId)
	local Animator = character.Animate
	local NewPose
	
	local success, err = pcall(function() 
		local Model = game.InsertService:LoadAsset(animationId)
		local Folder = Model:GetChildren()[1]
		NewPose = Folder:GetChildren()[1]
	end)
	
	if success then
		local OldPose = Animator:FindFirstChild(NewPose.Name)
		if OldPose then
			OldPose:Destroy()
			NewPose.Parent = Animator
		end
	end
end

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		ChangeAnimation(character, NewAnimationID)
	end)
end)

You can make it more complicated to work for whole animation packages, this is just for the individual animations.
(EDITS: kept optimizing XD)

11 Likes

If you’re trying to change the default character movement animations, it’s as simple as ripping the default character animation script and changing the values in the script.

Just jump into a test play and grab the LocalScript inside your character called “Animate”.

It’s fine if you delete all the StringValues under the script.

Next just edit the script and change the IDs.
They are clearly organized and labeled.

Then you just slap that baby into anything that gives it to a player.
It should override the defaults.

Ideally you would put it in “StarterCharacterScripts”, but it doesn’t really matter.
You could even put it under “StarterGui”.

Here’s an example of my character’s animate script.

6 Likes

Sorry for the late reply, but how does it know which animation to change?

It’s based on the name of the pose (idle, run, swim, etc.) which is already set when you insert it into your game like this.

So if you go to an animation package, like this one, and click on the read more and click on any of the included poses, let’s do the run pose, the id you’d enter is that of the pose url (619543231 in this case) and the code knows which one to replace based on the name.

2 Likes

Whenever I do that, I have replication issues I think it is. Players will glide across the floor for periods of time until the animation decides to play. It happens temporarily upon a new player entering the game and happens once again to the same player randomly thereafter.

1 Like

When was the last time you updated your fork of the animation script? I had that issue for a while until I updated all of them. Haven’t noticed it since.

2 Likes

I’m not sure I entirely understand what you mean by that.

1 Like

To override the animation script, you typically copy the one out of your character and replace the script that would otherwise automatically load - this is called forking, as you now have your own branch / version of the script that no longer updates automatically.

Roblox may have updated the Animation script to solve the issue that you were seeing since the last time you tested this, but you wouldn’t have received that updated version of the script.

4 Likes

Oh yeah, I just didn’t know what you meant by “forking”. Each new project I make, I take a new version of the script from the player since that’s the fastest way to get one. The issue occurred during the same sitting as that, so I’m not convinced it has to do with versions being outdated.

I am having the exact same problem. Can’t figure out the issue either. My version of the script is 100% up to date. The character animates on the client, but the movement does not replicate to the server.

Edit: I ended up just creating my own animation function that plays a certain animation when certain keys are pressed, and removing roblox’s default animation system. This system works fine, though it is annoying it is so difficult to use custom animations for player movement.
For example:

W, A, S, and D trigger the run animation, Space :Play()'s my jump animation, ect.

4 Likes

The first section here should do the job…
https://developer.roblox.com/en-us/articles/using-animations-in-games

IgnisRBX

3 Likes

I changed the idle animation but it didn’t work.

1 Like

Idle animations have 3 different ones, with different Weights, make sure you’ve handled those as well

I did but it still didn’t work.

2 Likes