I want to create a timer with code to replace the animator component, I will then display the frame of animation I want based on the state of my new timer
I was thinking about something like this:
public float animSpeed;
public float currentTime;
public float targetTimeToChangeFrame;
void Update()
{
if (currentTime>targetTimeToChangeFrame)
{
currentTime = 0;
ChangeFrame();
}
currentTime = currentTime + animSpeed * Time.deltaTime;
}
Is this method anywhere near best practices of an accurate way to manage time?
Is it similar to how the animator component manages time?
Thanks for the advice
PS: To answer any possible questions about why dont I just use the animator component, its unecessary overhead since I have come to the point where my game isnt making use of any of the animator states, transitions, and other features, and atm Im just lifting the values off the animator state info to run my own animation logic, and its very clumsy and unecessary to do so