How to change the Idle animationS of a StarterCharacter?

Hey there!

I’m making an animated StarterCharacter, it is a dummy (R15).
My goal is to make a custom Character System and I want the player to be able to choose his animations while creating his character.
So I made all of this, it works nicely but I’m facing a problem, you know in Roblox, when your Idle animation, sometimes, a cool Idle animation is played, like a second Idle animation, longer.
Of course, the animations available in my game will be made by my Group and I think it could be really nice if the player can have the two idle animations like the Roblox-made animations.

At this point, I made two “PlaceHolder” animations, so one is looped and a second one for the longer animation. In the Roblox animate Script, there are two Animations instead of one. image
So I made a simple test, I took the two animations in my character and I played each one on a new Dummy.
The results are: “Animation1” is the normal idle animation and “Animation2” is the longest animation for Idle I’m trying to add to my StarterCharacter. I printed the Looped boolean to know if their animations are looped and their priority and the result is true for both and priority = ‘Action’.

So, actually, we know there are two animations for the Idle State, the first one is the “regular breath” and the second one is cooler and longer than the first one. When you see the animation on your character, the Breathing repeats but sometimes, you can see the second animation plays. We know both animations are Looped and Priority set on ‘Action’.

So I made my two animations, looped them, priority set on ‘Action’, and added them to my script. My script changes the AnimationId of the Animation1 and Animation2 with my own animationId. So I have the same thing as Roblox. I have one “normal animation” and one cooler and longer which I want to plays sometimes.
They are both looped.

Now, when I’m Idle, the normal animation plays and never stops. When I move, it stops, and when I’m Idle again a random animation between both plays and never stops. The animation2 plays rarely when I restart Idle.

Thus, to sum up, the problem is that the second animation doesn’t overlap with the first animation sometimes but it plays a random one each time I restart the Idle state.
I think the problem may come from a boolean in the Roblox-made Animate script like ‘CustomAnimation’ and if it is true, then it doesn’t alternate the two idle animations to make it easy. I don’t really know. I’m searching for a solution inside the animate script. If anyone has any idea, I’ll appreciate it.

Thanks in advance!

Adjusting the weight of the animations is probably required, but changing the priority would probably work as the best option. The first animation could be in idle priority while the second is action, if you’re attempting to replicate the same system that Roblox animation bundles do.

I’m not quite accurate about how the Animation script is handled. You can fork the script and study it thoroughly.

1 Like

I’m back, and I found the solution by exploring the Animate script.
So if you want an explanation, your animations have to be looped and you ABSOLUTLY NEED to rename the last keyframe ‘End’. Then you insert the animationId into the script’s children. And you’re done. You can manipulate the “Weight”, the bigger, basically, the script will add the weight of all your animation, each time the animation plays, at the end, it will role a random number between 1 and the totalWeight, if this number is bigger than the weight of the first anim, it will plays the Animation2.
I recommend you to read the Animate script.
Enjoy.

3 Likes