Smart Animations - Animating Movement

SMART ANIMATIONS

Animations that change your position

Have you ever wanted to make a animation with the movement in the animation or you simply hate having to animate everything in place for simple things like vaulting a ledge or a quick dash/roll and then scripting the movement manually or maybe you just simply find it too complicated to do those things. I did and thus I present the concept of smart animations.

Video Overview

Questions

What does it do?

  • Automate/Move your actual character in the world when an animation plays
  • Come with simple to adjust built-in settings to ignore walls/gravity or work with world physics

What do I need for it?

How do I use it?

Change-Log

  • Version 1.0.1 Module-Fix
    • Fixed an issue with the frame sorter that would occasionally cause animations to clip back for some frames, due to playing out of sync/order.
  • Version 1.0.2 Module-Update
    • Added a :pause feature to visual animation
    • Tweaked the client-sided code to make visual animations run through collisions more smoothly on the client
    • Fixed the issue of being able to play the animation track over itself. Should no longer play over itself if already playing (aiming to restart the whole animation track instead in the future like normal animations)
  • Version 1.0.3 Module-Update
    • Added a parameter for physical animations called power to increase the distance of a animation without having to change it
    • Added better simulated gravity to physical animations
  • Version 1.0.4 Module-Fix
    • Added collision detection/raycasting to physical animations to remove the potential clipping through walls during high speed movements
106 Likes

Man I LOVE THIS, I already have made vaulting and stuff like that but honestly I always find tedious to do animations and do scripts to make the animation movement translate in the game, this sure helps a lot to save up some time, this must be one of my favorites modules ngl, pretty good job mate!

7 Likes

Would be useful in the future for animating, so thanks for sharing this!

3 Likes

Awesome work! Although, it’d be much more practical if you implemented events for animationTrack.Ended, animationTrack.KeyframeReached, animationTrack:GetMarkerReachedSignal ect

2 Likes

Root motion, this is something that should be in Roblox by default, great job.

8 Likes

I get these errors.
18:42:17.504 Animation failed to load, assetId: https://assetdelivery.roblox.com/v1/asset?id=14672564247&serverplaceid=0 - Server - Smart_Animation:58
18:42:17.504 Stack Begin - Studio
18:42:17.504 Script ‘Workspace.Dummie.Smart_Animation.Smart_Animation’, Line 58 - function Check - Studio - Smart_Animation:58
18:42:17.504 Script ‘Workspace.Dummie.Smart_Animation.Smart_Animation’, Line 90 - function Create - Studio - Smart_Animation:90
18:42:17.504 Script ‘Workspace.Dummie.Smart_Animation’, Line 4 - Studio - Smart_Animation:4
18:42:17.504 Stack End - Studio

Does this only work for R15 or it works for R6 too?

Should work on both. It looks like your error came from the animation not loading, but I could be wrong.

1 Like

Hi this seems like a really useful tool! I was following the tutorial with a custom rig and although the plugin outputs that the animation was converted, the keyframes do not change to say “CFrame…”. When I play the animation back, the character still moves as well, unlike yours in the video. Any help would be greatly appreciated!

Pretty sure roblox changed the way animations are stored/saved since then so I would have to redo all/some of it again to make it work in my free time.
Edit: Also I don’t think I ever added true support for fully customized characters. Mostly an R6/R15 thing since the plugin checks for Torso or LowerTorso Movements.

2 Likes

This module looks very clean ! But what about performance, are they impacted?

Not really a the kind of person to ask about performance, but if I had to guess probably yeah, due to the computing/reading of the keyframes of the animation before rendering/playing them. Nothing I’ve personally noticed in the little time I did use it.

1 Like

Hi there, it didn’t work out very well.

It could be because I’m using Moon Animator with easing styles that there are too many root cframe changes, but I can’t find any alternative to keep my smooth animation without it looking like this.

Thanks,

Does this have connectable events?
I tried to use animationTrack.Ended:Connect( ) but got an error attempt to index nil with 'Connect'
If it doesn’t have events, will it? Or can you tell me a different way to figure out when the animation ended?
Also does it matter if I change the names of the variables like Animation_Track into animationTrack or Smart_Animation into smartAnimation?

Can you explain the local variable that has a colon followed by a string then its definition?

The Colons followed by the green text/string is just me organizing it in my own code and defining it it’s not needed and just how I code.

The variable itself is me using the module and calling the :Create function inside it to create a fake animation track to use by inserting the a humanoid, animation, and then optional settings to configure the smart animation. Once I do that I can play the full “smart animation” by doing [variable_name]:Play() and it will play the normal animations + the tweens for movement synchronized.

1 Like

You can change up variable names that fine, but if you want to use actual animation events tied to the animation track you have to redirect it or grab it from the smart animation. The path to the actual raw track is the smart animation variable and then .Track after it as shown below.

local smart_anim = module:Create(Humanoid, Track)

smart_anim:Play()
smart_anim.Track.Ended:Connect(function()
     print('bla bla')
end)
1 Like

is there a way to make it not use tweens? because it looks kind of janky and doesnt allow the character to move at all except for the animation

Hello, I need your help, it is very urgent, or I can contact you. My problem is that Roblox updated some things in the animation and changed things, such as the model in which the animation is stored. It was stored in serverstorage and It replaced it with something other than the model that saves anim in . I tried for many hours to solve this problem, but it did not work. Please upload a video explaining the beginning of the animation in your channel to run successfully after updating… I think u have to update the plugin is there any way also like searching in the documentation of something alternative of that

The character moves but he goes a bit backwards.

I fixed that but how can I make him stop moving at certain times?