Animation Handling (Loading and playing)

Hello! I’d like to know how everyone uses, loads, and handle animations; more specifically for vehicles!
I use AnimationControllers and play through server scripts with individually set Network Owners.

This method is REALLY buggy though, and I’m looking to improve. (Sometimes, clients do not replicate the animation that the server is playing and only sees the animation live when in close proximity.)

I’d love to hear from @BanTech on their method of trying to handle animations or at least an insight.

1 Like
  • Don’t play animations on the server
  • Don’t use animations for vehicles, period

If you don’t recommend animations for vehicles (buses and trains), then what would you use instead? TweenService is definitely a no-go.

Just calculate it with RunService. Furthermore, TweenService is still a better option.

You should ONLY play animations on the client, the animator object in the Humanoid/AnimationController replicates the animation to all clients. (The animator object is created by the server)

TweenSergvice isn’t a flexible option where you can treat the model as joints better than animation editors and the ability to get animations through uploads. Though it MAY be possible through welds and use CFrame for weld offsetting, thanks though! Also, with animations, I’m animating multiple parts then compressing it into one animation.

TweenService would be me scripting multiple lines just to achieve what can easily be done via Animation Editing.

Playing animations via the client on a model that isn’t directly connected to the player itself? I assume that NetworkOwnership would also be needed for this as well?

For SCR we play door animations from the server, as the server is the owner of the train model when you arrive at a station and unlock the doors.

This does have some minor glitches from time to time if the client hasn’t preloaded the animation yet, but generally it works well. We place the animations in a location that the client can see (rep. storage for example), so that we can preload them in advance.

We do something similar in The Lanes despite it being your own character that gets animated, and the reason for this is to match up the movement with the release of the bowling ball. The ball is owned by the server for the actual bowl, so where the server thinks the ball is matters most. Again, we preload animations, so in theory the delay to the player is just the network delay for replication.

When dealing with animations for a specific player that doesn’t need synchronisation with the server, e.g. dispatching and guarding in SCR, we play those from the client and let the replication occur via the engine.

5 Likes

Ah, thank makes sense! Thank you very much. :smiley:
I didn’t think that SCR would also experience glitches as well since it seemed to work pretty well, but at least I’m not alone. :slight_smile: