Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I replace the default ROBLOX animations? (run, walk, idle, etc.)

I'm making a game, and I need a custom walking animation for it. I've already animated the walk animation but I really need help on how to replace it. I've tried many tutorials online and not a single one of them has worked. Can anyone help? (It's for r15)

2 comments

0

In the Animate LocalScript

0

uh where is that exactly

1 answer

In every player, there is an 'animate' script located in that player's humanoid. In order to override their default animations with YOUR own animation, you'll need to change the walk animation id located inside of the player's animate script. You can complete this task by overriding their walking animation every time a player joins or dies. For example, first you'll want to copy and paste the animate script into the workspace from the player's humanoid. Inside of that script, their should be a piece of code indicating the walking animation id that you can personalize to your own animation id. After changing the id, simply put the new animation script inside of the Replicated Storage tab. Finally create the code that duplicates the animation code and replaces it with the default animation script every time the player joins/dies. In the end, your code should look similar to this example.

local PlayersService = game:GetService("Players")
local newAnimateScript = game.ReplicatedStorage.Animate --Your edited animation script

PlayersService.PlayerAdded:Connect(function(player)
	local newAnimate = newAnimateScript:Clone();
	if player.Character then
		if player.Character.Humanoid:FindFirstChild("Animate") then
			player.Character.Humanoid.Animate:Destroy();
			newAnimate.Parent = player.Character.Humanoid;
		end
	end
end)

4 comments

0

Can you tell me if there's any difference between game.Players and game:GetService("Players")?

0

There's no difference. I just have a habit of using game:GetService("Players")

0

Wow you are getting confused with Javascript. What are the ";"s about?! Lol.

0

It's habit

This discussion is preserved as it was. New answers, comments, and votes are closed.