Smooth fully dynamic animation system

Simply put, I want to make a fluent animation system, using CFrames applied to the character’s Arm Motar6Ds. R6 is what im using seeing as its just an itty bit easier.

I am not requesting a script, more of how i would execute this. I want it to be as realistic and as smooth as it can be. I also need animations to be willing to change on the fly, like blocking mid attack.

My idea was to do some work with lerp and other systems, would this be ideal? I know of some FPS games that use lerp, and springs, How would i create the spring? How would I have animations be realistic feeling?

I have not done any attempts, mainly because i dont know where i would start on creating this.

P.S. How would i do a realistic sword knockback when it hits a part not belonging to a players character? Would spring fit this?

1 Like

In order to create a pretty basic “smooth” animation, you will need a method to firstly create character pose key-frames (dynamically, statically, whatever), and then interpolate between these frames. I will just talk about interpolation of frames for now.

To make it easy, let’s just treat each of the characters jointed limbs as a vector. For the character to ‘move’, we need to translate the vector from one pose to another. With linear interpolation, the implementation should be trivial.

function lerp(v0, v1,t)
  return v0 + t * (v1 - v0)
end

With this, we define v0 as the start vector and v1 as the ending vector. Then, we increment t from range [0, 1]. If we fed a raw time value of seconds to the function, then it would take 1 second for the interpolation to go from v0 to v1. If we want it to take longer or shorter, we can simply scale variable t by some factor.

However, you also mention springs in your example. By having a springy effect, your animation would look more natural in mimicking an actual human, as humans don’t perfectly move their limbs to exact coordinates. By using a spring, we won’t be interpolating anymore, but instead simply simulating a spring. By using the DEQ for a Damned Harmonic Oscillator (cool name for a spring), we can then define a function that calculates the position of the spring-end at any point in time. We can then work to represent our spring model in our vector space rather than just up and down.

4 Likes

Yea sort of guessed that. Take the answer, i really shouldnt have expected more.

sorry to be that guy, but don’t you mean “Dampened” Harmonic? lol

1 Like