- Home /
how can i know a percent of animation ??
how can i know a percent of animation ??, I know the script but it does not help much animator.GetAnimatorTransitionInfo(0)
or animator.GetCurrentAnimatorStateInfo(0)
, I want to swap the animation but I can't swap correctly, so i think if i know a percent of animation, I can swap animations appropriately, ex : if this animation has playing 75% of 100% then play this animation
Answer by TBART82 · Oct 11, 2017 at 06:34 AM
To be honest, I'm really not sure what you're trying to do. But, you can calculate a percentage by doing:
float percentage = (current / maximum) * 100;
This will give you the percentage, so from there you could do something like:
if (percentage >= 75) {
// Then do something when its 75% complete.
}
But then again, I'm not sure how you are going to access the variables required for the calculation. Hope you can find a solution!
TBART82!
i need the percentage of animation,, that's for swap the animation correctly, i hope you can help me :D,,
Okay, well first things first. Is the animation for UI or is it for a character, or something else?
for character, i want to use it for the next animation,,