Custom Walk Animation only gets applied some of the time

I have this script to apply a custom walk animation:

However, for some reason, the only check it can consistently get past is Check1. It only ever reaches Check2/3 and applies the animation like a fifth of the time. Im not sure what the issue is.

1 Like

a little lost by your explanation. I am not seeing any reason the code wouldnt run properly can we layer some more prints in?
put this at the very end under Animate.Run

print(Animate.walk.WalkAnim.AnimationId)
print(Animate.walk.RunAnim.AnimationId)
print(Player.Name , "'s Character Has fully loaded...")```

Let me be a little more clear. What I mean is, most of the time it only ever prints Check1. About one fifth of the time, it prints the other two and applies the animation. This prints dont give me any new info,.


An example of what it prints, most of the time.


An example of what it prints when it works.

The goal is to narrow down what are* the conditions for it to ‘work’ - gotta figure out what occurs ,and why?

like reset constantly, maybe it never works when the player first spawns in.
I cant test for you but you gottha get to the root of the problem.

First of all, cant reset, my game has no reset and no respawning. Second of all, Ive already narrowed it down to not getting past the player.characteradded:connect function. What I dont know is why.

Hm? Have you tried testing outside of studio? if u cannot respawn via test have you tried testing via local server?
image
you can try Player:LoadCharacter() but you said there is no respawning

Yes, I have tried testing out of studio. My game intentionally has no respawning. When multiple people play, some people get the animation and some dont. When testing in a local server, I get the same results.

And when it doesn’t work do you index the animation ID to see if its correctly changed? via explorer

Not every time, but the times I have, the ID wasnt changed. As I would expect, given the checks didnt print anything either. Id like to mention, I have other scripts similar to this one that have similar results, not working most of the time. (For example, adding a hat to the character.) I dont know why, as, i have another place in the same game that has the exact same scripts, and they work fine. My only explanation is that it might have something to do with the custom character, but I heavily doubt that, given its just a standard R6 rig.

Oof okay I suspected you maybe had multiple scripts monitoring and using Player,CharacterAdded to do things but that shouldn’t be a problem that would error. And this customer character… has Animate in it? right?

First of all, I might be misunderstanding you but, there is no error. Second of all, yes, it has Animate. if it didnt, it wouldnt even be able to do the standard roblox walkcycle. Third of all, I doubt this is caused by multiple scripts using Player:.haracterAdded because all of the scripts that use it have had this same exact issue since i made them.

The problem being that multiple are using it is that its even more harder to narrow down what the problem might be if you have so many instances and they all have the same problem. I’m beginning to believe the problem isn’t your code at all.

The only other idea i have is that it takes too long to load. my game relies a lot on procedural generation, and even with dynamic generation, it does have to generate a little upon first joining, causing a slightly extended loading time. considering my game is held together by duct tape, i wouldnt be surprised if that has something to do with it.

run the game (f5)
you will find a local script called Animate under your character
{9711502D-1D62-47C8-AC26-D6FE1A3DCF05}
copy it (ctrl + c)
stop the game (shift + f5)
paste the script (ctrl + v)
move it into starter character scripts
{7FE1EB2C-5C56-48A1-A236-D0B97E34BEA0}

open the script and search for a table called animNames
{DF277180-4F30-4C9F-8AA0-058A11CDAA83}

you will find animation names like idle/walk/etc… and an id change the id to your animation url

under the script search for the animation that you want to replace (again)
{E8C451C2-9656-480F-BDFF-BE14018D8F72}

and replace this with your animation id
{AC9215E6-CC0E-481C-A780-5311B04F8C65}

2 Likes

While this doesnt solve the issues with the other scripts, it did solve the animation issue. Thank you so much!

1 Like

Nevermind, still not fixed, sometimes the animation just… doesnt work?? And you just walk around without an animaton. Im not sure what the issue is, it seems uncommon but its happened more than once.