How to add (not replace) Custom Animations to Custom Characters

I’m trying to make a custom character and animations; I have succeeded at both by watching this video https://www.youtube.com/watch?v=zEvDbGf9S-0, but I want to add a pre-walking animation before the character walks, add an attack animation when a player hits a certain key, add a role animation when the player hits the space bar. I’ve tried looking around the dev forum for answers and how I would go about adding these animations, but all I’ve seen is how to replace already existing ones. Does anyone have links to some tutorials or wiki articles that could lead me in the right direction?

To play a custom animation, you need to load an animation into your player’s Humanoid using LoadAnimation , and then :Play() it.

Example:

AnimationObject = Instance.new("Animation")
AnimationObject.AnimationId = "your animation ID"
Animation = Humanoid:LoadAnimation(AnimationObject)

Animation:Play()
Resources:

Humanoid | Documentation - Roblox Creator Hub

Animation | Documentation - Roblox Creator Hub

2 Likes

Thx so much, super helpful, but one last thing. I want to add an pre-walking animation before walking, could I get rid of the animation script and replace it with a animation script that uses user input. would it work the same, and would I have to worry about the animation script being a local script?

Yes. You can create a custom user input animation system using ContextActionService. If you want to have your animation modified at the start of your run animation, you could also create a separate ‘starting’ animation with a higher priority than the main animation. This would mean it plays instead of the main animation when it is :Play()ing.

Here is what the developer hub has to say about your replication question:

Screenshot_2020-07-19-20-47-12

1 Like