Updating Animation By Frames

I have an object that has an Animator attached to it, and attached to the animator is a animation controller that only has one animation state inside it. What I’m trying to do is play that animation at the beginning of my application’s startup, my object starts at 0.0 time, and with every frame, it is set to a specific value within that animation. For example: I have a 5 second animation, and I want to play that animation over 6 frames, so every frame I would set the current “animation time” to that frame number. (In this case, frame 1 is 0.0s, frame 2 is 1.0s, frame 3 is 2.0s, etc.)

Now what I have just given you is strictly an example, so that means that this animation isn’t always going to be 5 seconds long and I won’t always want it to update over 6 frames.

I hope someone can help me with this, and thank you for helping out in advance.

I managed to come up with a way to do this. What I did was use the animation duration, my requested fps and delta time to figure out the Animator.speed variable and update that to interpolate properly.