- Home /
Select frame for Animation
I'm working on a game and I have multiple animations but they're all in one animation. This was a problem caused by my animation software (FragMOTION) and well I want to be able to select the certain frames to play a certain animation when a key is pressed. I looked at the AnimationState.time stuff and tried it but it seems to not work. My current code is
var time : float = 0.0; function Update () { if (Input.GetButtonDown("Jump")) { animation.Play("Jump").time = 259.0; } }
Frame 259 to 266 is my animation for the jump ,and frames 1 to 224 is my idle animation, ect. How would I be able to loop certain points from 1 frame to the other?
Answer by The-Arc-Games · Aug 07, 2012 at 06:53 AM
Fortunately you don't have to do it this way. Unity's animation importer has a function to split the default take into different animations.
Select your model in the project tab.
Make sure that its scale factor is set to 1 (some exports make unity to set it to 0.01!).
Scroll down to "Split Animations" and press the "+" button on the right, and specify your animations.
Should save you quite a lot of time and work :)
Your answer
Follow this Question
Related Questions
Need help with animation rewind 1 Answer
A quick question about animation frames 1 Answer
Play sound on anim frame 1 Answer
how to stop animation loop? 1 Answer
random animations? 1 Answer