- Home /
Controlling animation frame by frame from script
Hi there,
A Unity and C# newbie. I am trying to take screenshot at each keyframe of an animation. As far as I can understand from google and unity answers searches using anim["animation_name"].normalizedTime = time is the way to go. However my animation doesn't change its state with it. I enable animation at the void Start() and using Animation. Here is the code:
for(double j=0;j<1;j+=0.1)
{
anim["T2B"].normalizedTime += 0.1f;
CaptureNamedScreenshot();
}
Also I tried to manually set times of animations manually and take screenshots, I cannot do that either. It only took one screenshot.
anim["T2B"].enabled = true;
anim["T2B"].normalizedTime = 0.5f;
CaptureNamedScreenshot();
anim["T2B"].normalizedTime = 0.9f;
CaptureNamedScreenshot();
Is there a better way? Thank you for your time
Your answer

Follow this Question
Related Questions
Is there a new retargetting system for the animation in 5.5? 1 Answer
All AI animations stop on first frame 0 Answers
How to stop animation from playing in c#. 7 Answers
How do I stop moving when attacking? 1 Answer
Attack Animation problem 1 Answer