De-loading animations from animator?

Do loaded animations on an animator or humanoid have a way to be deloaded?

I want to animate from the server on certain animations, but I worry that if I load the same animation on an animator it will increase memory taken. Potentially negatively affecting performance.

Do animationtracks that are loaded on an animator even take much space to worry about this?

Why do you need to animate from the server? You can just fire remote events to all clients and have them all locally

Well, my thinking is that I want to avoid a chain of latency.


1st Idea
Server → Player (By Remote Event)
Animation Propagation:
Player → Server → Rest of Players


2nd Idea
Only animation propagation:
Server → Rest of Players


It might not matter that much, but it also lowers the complexity needed for my animation system.
I’m also using this primarily to animate attacks that need to be verified by the server. So why bother adding more lag?

It actually doesn’t matter, its more efficient to fire to all clients because if you ran it on the server, you’d be running it on the clients AND server, using more memory.

Bordering on XYP but I guess because this knowledge isn’t really out there, despite it being implied.

No, you cannot deload animations from an entity that can load animations. This would easily be revealed by searching the DevForum for a counteracting function to LoadAnimation. There is one technical way to “deload” (quotes because it’s not actually deloading), but I don’t think it’d be wise to share. It’s unnecessary work and might spawn more issues than it solves.

If your worry is about loading the same animation on Humanoids consistently, don’t worry about that. First of all, animation data is cached, so every subsequent call of LoadAnimation will return that animation data and pack it into an AnimationTrack (sound familiar? ModuleScripts). Second of all, if you’re wary about calling LoadAnimation several times (even though you don’t need to be at all), then just cache tracks somewhere in your script. Easy workaround.

AnimationTracks are negligible in cost as an instance alone. The main worry is the asset they’re working with (the animation uploaded to the website), which is the main point of memory consumption. This can very depending on what your animation is comprised of (length, complexity, keyframes, so on).

4 Likes