How to stop a loop on a sprite animation?

Hello everyone,
I’m creating and at the same time learning to do a simple 2d shoot ‘em’ game.
I’ve created a character which has 8 separate parts to it. I don’t have limbs. It’s a simple robot.
I would like its mouth to open and stay open when in the animation sequence, and a visor/mask it has to rise in the idea sequence.
Following some tutorials everything is on a loop and looking in the Inspector it shows no tick box to turn off loop on hat one part of the character.
Do I have to do this in code, or am I missing a package?
Sorry about this.
If you need more information,

I’m more than happy to do that,
Kind regards

This is more of Animation question than 2D, but Ok. There are many different approaches that could be used for this:

  • handling some stuff in code - if you use this approach be careful with which subobjects and properties are controlled by animator and which are controlled by code. It’s easy to get in situation where they are fighting against each other. Even if current animation doesn’t change a property but different animation does, trying to modify it from code may cause issues
  • animation layer system - having different state machines for legs (walking, jumping) and upper body (throw, shoot, hand guestures) is one the commonly used examples when describing layer system
  • separate animator for some of the subobjects - this would have similar result of having multiple independently executed statemachines
  • using multiple animations: animation 1 do something with visor closed, animation 2 used for transition during which the visor opens, looping animation 3 doing something with visor opened, animation 4 closing the visor. Sub-state machines can be useful when using this approach to keep the high level logic less tangled.
  • automatic transition interpolation - sometimes it’s not necessary to manually create transition animations. Depends on art style and complexity of transition. You can specify the transition length and Unity will automatically make a transition interpolating between the states of two animation. This works best with 3d skeleton animations, sometimes with 2D multi body part animation, and almost never works with sprite based animations. In this approach you only have: animation 1 do something with visor closed, 2 do something with visor opened, and the animator config for transition between them appropriately set params.

Each approach has it’s own tradeoffs and potentially added complexity. You will probably have to read some articles or watch tutorials to learn more about these techniques.

1 Like

Hello Karliss_Coldwilld
Thanks for the answer.
A lot to digest, but I’m up for it.
Sorry for not posting in Animation.
I thought I was missing a tick box in the Inspector, because I’m sure I saw a video on rigging, and you can turn off Loop from a check-box.
Anyway, Unity is a blast to learn, and I’m doing this, so I can help my younger kids learn Unity, C# and Blender.
Thanks again and kind regards.

the tickbox is missing because you are in the wrong menu, you have to click the animator and then the animation state