Why are my animations being delayed?

Hi, I’ve recently tested my game and have found a bug that happens whenever I play an animation. The bug is that sometimes when i play an animation it will delay a 1-2 seconds after. This only happens for the first few animations all of them after that work fine. I’m not really sure what to do cause this isn’t something anyone would just know. Here some videos for a better picture.

Delay

No Delay

You can kinda see the animations happening all at once with the delay one but with No delay it’s more smooth. This happens to just about all animations so I can’t give a specific script. But if you really need one I’ll give it to you. Any help would be appreciated.

Regards, powerdud

1 Like

You can give a code sample if not a specific script so it’s at least visible how you’re using animations in your game. Without knowing what you’re doing even in part for the scripts that are presenting this issue, becomes difficult to help.

The only thing I can offer here is: by any chance, are you playing those animations from the server? This kind of behaviour tends to happen when you do so. Animations should be played from the client.

2 Likes

I am actually playing from the server. I’ll try your suggestion and see if it works.

1 Like

If you play animations from the client, is there a way to tell when the anim reaches an event on the server? I want to play animations from the client in my game but I don’t know how to detect if an event reaches on the server.

1 Like

I’m no expert but I find there being no reason to detect that the event has reached the server cause it’s almost instant when using an animation. Objects I’m not so sure about.

1 Like

If the server is able to fetch a reference to the AnimationTrack that the client plays, then you do what you normally do: use GetMarkerReachedSignal (or for named keyframes, KeyframeReached). If this does not help you, please make a new thread regarding that topic rather than using this thread for it.

1 Like

I am reviving this topic on behalf of the Roblox Developer Community, LoadAnimation in Humanoid is now deprecated and should not be used in new works, in fact, if you WANT to PLAY your animations without delay, use Animator instead. Animator:LoadAnimation()

Links of Humanoid:LoadAnimation function: (You can see here that it is now deprecated)

New method you should use:

As said in this topic, LoadAnimation is deprecated because it creates new “Animator” object when called in a LocalScript therefore creating a delay on animations playing or many other reasons that I don’t know about because it seems to work fine to me, here’s the topic:

You also should Preload any sounds and animations used for doing cutscenes or any animations that you think will be bad if it has any delays at all:

11 Likes