Having problems with manually animating the Animator, some frames happen twice
So, to give a little background, I am making a fighting game. As a part of that, I want to have ultra precise control over the frames of an attack. How many frames it will be in windup, how many frames it will be in the attack phase, how many frames it takes for the cooldown to occur.
What I have done, based on a previous post, was turn off the Animator component, and in my code I have something like:
FixedTimeStep = 1.0f/60.0f; anim.Update(FixedTimeStep);
This seemed to be working fine, but as I was working on the part of my code that handles attack recognition I noticed something odd, an attack was lasting a frame longer than I set it up to. Specifically, the frame at 0:08 on the timeline (which has a sample rate of 60 by the way) was happening twice. When I put an attack to end n that frame starting from frame 0:05 it should last for 3 frames and then terminate, but it instead lasts for 4 frames. However, if I set the termination point at 0:07. it acts as it should, lasting for 2 frames and then terminating.
After some more experimentation I noticed there's a spot where the animation catches up to itself at time frame 0:13. I had a theory that it might be due to the fact that the animation time frame (1/60) is a repeating decimal, I tried changing the animation time step to 1/40 and the sample rate to 40, and this issue still persisted (albeit on different points in the timeline). I even changed the time step to 1 and the sample to 1 and still got behavior like this.
Does anyone know what's going on? My ultimate goal is to have complete control over how long an attack lasts in frames and at what points in said attack are the frames considered attacking and not. Again, this is a game where all the logic is frame based, not time based.
Your answer
Follow this Question
Related Questions
Why my animations stay on the last frame in the scene before trigging to play? 0 Answers
Animation clip only plays once when button is pressed, and then will not play again 2 Answers
Why don't created animations play the way you create them to play? 0 Answers
Animation Constantly Playing? 1 Answer
Scope Animation doesn't work?! 0 Answers