Just wanted to edit this post, since its no longer necessary. Roblox ACTUALLY added a way to scale animations!!!
You can do so using the :ScaleTo() function on models:
There is no need to do this programatically anymore, but you still can if you really need to. (for whatever reason)
Original post
Since Roblox refuses to add animation scaling functions (for some reason), I took matters into my own hands.
In my game, you play with R6 characters, and are able to morph into characters with a smaller/larger scale.
The problem with this is that animation offsets do not scale to your rig size.
So, I present to you: a proof of concept for solving this!
The AddAnimRig script in ServerScriptService adds a CollectionService tag to your player character. The name of that tag is specified in ReplicatedStorage.AnimationScaleTag. It also adds a “Scale” attribute to your character, which controls the scale of the animations on that rig.
You can change the animation scale by changing the “Scale” attribute on the character.
The HandleAnimations localscript in StarterPlayerScripts controls all the animation scaling logic. It will loop through every character (including NPCs) that have the CollectionService tag specified in ReplicatedStorage.AnimationScaleTag, and set all the joint offsets.
Everything else is as it always is. You dont need any custom function to play animations on characters that have scaled animations. Just call :LoadAnimation on the animator inside the humanoid.
You dont need a starter character, I just added one since you cant change the default rig type on an unpublished game.
This should technically work with any character, including R15 and custom characters.
The animation scale on characters does not replicate to the server, however it does replicate to other clients. (sort of, every client calculates it separately)
Code to downscale your CHARACTER is not included here, only scaling for animations.
This supports bones.
This has not been tested extensively, so it might be broken, maybe dont use for live games (yet?)
You can use this to scale animations on non-player characters.
There is no per-animation scaling. Its probably not possible.
It does work with extra parts, however bone animations are not supported.
Playing animations on NPCs does technically work, but you might have to restructure the code a little bit, since right now the script only accounts for player characters.
I might update the place myself to account for these issues
EDIT: Getting bones to work was actually super easy, I will update the topic in a while with some other improvements
I know right? I didnt see it coming either! Huge credit to this post for pointing out that you CAN actually set the Transform property without it resetting instantly!
There is no module now. There is just a “HandleAnimations” localscript in PlayerScripts, which handles everything for you.
The Animation Rigs inside your character are now no longer needed.
You dont need to do any magic for playing animations now. Just play them as you normally would, on your character animator inside the humanoid.
There is a new “AnimationScaleTag” value in ReplicatedStorage. It contains the name of the CollectionService tag that is used to scale animations. You can remove it and hardcode it if you want. Any character model that has that tag, and has a “Scale” attribute will have its animations scaled.
This means that this SHOULD work with R15 now, and custom characters as well.