Unity2d Animation won't loop - animation

Using unity 4.3.4f1.
I started a new project with only one game object on wich I added an animation with 4 sprites. I choosed "Always Animate" from the Animator configuration oon the game object.
When I run the game, the animation play just one time. I see in the animator panel that my animation is replayed again and again because I only have one state. However, Animation won't loop when running the game.
Anyone knows why ?

Related

Unity Networking: how to sync animations on child object?

I'm making a multiplayer but I got stuck at syncing animations. My current player hierarchy is following:
The problem is that Marine object uses IK to aim up/down which means that I use OnAnimatorIK function. In order to use OnAnimatorIK, the Animator component must be attached to the same gameobject as the script using OnAnimationIK. This means I must attach the Animator to the Marine gameobject. If I do this everything works fine (if not trying to Network animations).
Now, if I attach Network Animator to the Player object, animations will not update remotely. When I try to attach the Network Animator to the Marine object, Network Identity component is automatically added too and it can not be removed. If I try to build with Network Identity component attached to Marine object I get error saying "You can only have one Network Identity attached and it must be attached to the root object". This means I should move my Animator component as well as the PlayerIKHandler script to the Player object to get rid of the duplicate Network Identity component.
If I do move the Animator component to the Player object it breaks my animations (model stands in T-pose) and I don't see anything animating even locally.
Clearly I'm doing something wrong I just don't know why. How could I sync animation using animator on child object OR how can I animate the model if the animator component is attached to the Player (just a dummy Capsule with scripts on it).

Unity Involve Instatiated objects in Animation

In the 2d-game the player should be able to shovel some dirt when he stands on a dirtpile. player allready has the animation for that, but the shovel has to be generated.
So i generate the shovel and trigger the animation. but the animator doesn't animate the shovel. Any solutions?
Why does the shovel need to be generated? If you just want it to be visible at certain times, you can go ahead and animate it normally in the Editor, then set it to inactive when you don't want it to be there.
Ok, so i found the answer my self. before Triggering the animation event Rebind the Animator.
Animator anim = player.GetComponent<Animator>();
anim.Rebind();

Unity - stop animation loop

How can I stop make unity continuous looping
what I have done
1- I add animator to my object.
2- I create animator controller
3- I create my animation
4- finally link my animation controller to my object
it works just fine , but it keep looping
how can I make it animate just once
In your project panel select your animation and in inspector unCheck Loop Time property. That will stop looping your animation :)

Unity apply idle animation to model

I created a model in Blender and posed it the way I want it to look. The character will never move and no animations will ever change.
I exported the character with animations to an FBX and imported it into Unity 3D. After dropping the character into the scene, the character's pose is back to the default take.
How can I force the character to use the pose that I want? Do I have to do it in script or is there a setting that I can change to make it play the idle animation at all times?
Putting your model in the scene will not invoke idle animation, animation and rendering is two separate thing. To always play a certain animation on a model you have three option -
1. Via Legacy Animation -
Select you model in the scene, remove the default Animator component and add a new Animation component. (Animator and Animation are two different component type.) It has an option of selecting an animation clip. Drop your animation clip there and choose 'Play Automatically'.
2. Via Script -
You can add Animation component, attach multiple animation and select which one to play via script too.
You can also do this for meca-anim way which is explained in the next point.
3. Via Meca-Anime
Every model has a default Animator component. It needs an animation controller object to run. Create an animation controller (Click on create button in project view). Attach the controller to the Animator component. Double click on the controller to open Animator view. Drop your clip there and make it as default. The default animation plays automatically now. Using Meca-anime has many advantage over legacy way, which is beyond the scope of this answer. Check the following link instead -
Mecanim vs Legacy Animation

An sssue about CocosBuilder timeline animation

I've created a CCLayer by using Cocosbuilder. There are two timeline animations called "MyAnim1" and "MyAnim2". None of them are auto-run. MyAnim1 is chained to MyAnim2. I'm using CCBAnimationManager to run the first animation. And it works and the second animation is chained to animation 1 as I expected. But here comes a problem. The first animation goback to its initial status when the second animation start. Is this a bug? Is there a way to keep my first animation status to the end status when the second animation starts?

Resources