- Home /
Concurrent Animations using an Animator?
Hi all,
I am stuck on how to do something so hoping someone can help.
Basically i'm making a 2D game (Unity 4.3) and currently working on a "cannon" prop, which powers up to fire a projectile. I've set up an Animator component with various animations for the following states:
Idle (cannon gently bobs up and down)
Powering Up (cannon shakes violently)
Fire (barrel jolts forward, and exhaust backwards)
those are set up and are working nicely, using an "isPowering" parameter that I change the value up in code.
My problem:
My cannon has a glass lid, which shows the projectiles through it. I want to play an animation showing the projectiles jiggling around when the user powers up the cannon. I want this animation to play once only, and at the SAME TIME as the "powering up" animation.
When I tried setting up my "Lid" animation in my main Animator, I found that the animations only happen 1 at a time, so my projectiles jiggled about, and then the cannon began powering up, which isn't what I want.
Additional problem:
My lid animation consists of 6 sprites, where the projectiles basically loop round and around. I think i'd like to try playing 1 or 2 frames of my animation each time the user wishes to fire a ball, and next time, the following 1 or 2 frames in the sequences, and so on. Is there an easy way to have 1 complete loopable animation that only partially plays x number of frames, and then plays from that point onward next time?
Thanks very much for any help.
Mat
Your answer
![](https://koobas.hobune.stream/wayback/20220613123030im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Cookie Header With WebPlayer Unity3d 4.3 3 Answers
Simple animation on game object doesn't play via animation.Play 1 Answer
Android Anti Aliasing broken with Unity 4.3.0 -> 4.3.2, but works on Unity 4.2. 1 Answer
Performance spikes even with almost empty scene 3 Answers
Detecting Mouse Click on 2D Sprite 4 Answers