- Home /
How to call a function on animation frame when the animations are animated in blender?
I have created and animated a model in blender, and it works just great. But I am in a situation where I want to call a function in the middle of the animation, and I cannot get acces to the animation as if I had created the animation in unity. If I double click on the animation in unity it takes me to blender. If I click on it one time I can only see the fps and length, which both are locked.
I notice the later builds of Unity has 'Events' section in the Animation import tab. Perhaps this can help?
Answer by NWin · Aug 07, 2014 at 07:39 PM
What you can do is call the function after a yield WaitForSeconds (animation ["clip name"].length * (0.5));
the 0.5 is in place of how far into the animation you want to call the function even though it would make sense to be able to do ,length * (5/25), or something like that it always gives me problems, so just turn it into a simple float
an example if you want it 20 frames into an 80 frame animation just multiply the length by 0.25
Your answer
Follow this Question
Related Questions
Blender Animation Looping Delay Problem 2 Answers
hypercube animation 2 Answers
how to export animated .fbx to unity from blender 1 Answer
Generic root motion jitter? 0 Answers
Crossfade & IK - animation warping? 0 Answers