Hello Guest

Author Topic: Reducing the number of animations created  (Read 7316 times)

shaz68

  • Newbie
  • *
  • Posts: 19
    • View Profile
Reducing the number of animations created
« on: February 15, 2012, 03:34:06 am »
I have 30+ different spritesheets that all follow exactly the same animation pattern - 4 directions, 4 frames per direction. 

What I'd LIKE to do is create one animation and one animated sprite prefab with the four directions, then when I instantiate each one via script, tell it which spritesheet to use.  I don't see a way to easily do that - instead, it looks like I have to create an animation for every single one.  I will have several sprite collections, each one with between 6 and 10 of these spritesheets.

Is this right?  Is there an easier way than creating 30+ animations manually?
« Last Edit: February 15, 2012, 04:47:34 am by shaz68 »

shaz68

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Reducing the number of animations created
« Reply #1 on: February 15, 2012, 03:38:20 am »
Also, can you please explain the Create Collider option on the animations?  Does this mean I don't have to add a rigidBody or Box Collider to the animated sprite myself?  Do I need to set up the collision boxes on the sprite in the Sprite Collection?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Reducing the number of animations created
« Reply #2 on: February 15, 2012, 08:07:02 am »
I have 30+ different spritesheets that all follow exactly the same animation pattern - 4 directions, 4 frames per direction. 

What I'd LIKE to do is create one animation and one animated sprite prefab with the four directions, then when I instantiate each one via script, tell it which spritesheet to use.  I don't see a way to easily do that - instead, it looks like I have to create an animation for every single one.  I will have several sprite collections, each one with between 6 and 10 of these spritesheets.

Is this right?  Is there an easier way than creating 30+ animations manually?

You would have to create all the animations manually - there isn't really a way around it, I'm afraid. If you named them with numbers at  the end, all you'll need to do is select the first frame and click on AutoFill - that will probably speed up your workflow slightly...

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Reducing the number of animations created
« Reply #3 on: February 15, 2012, 08:10:03 am »
Also, can you please explain the Create Collider option on the animations?  Does this mean I don't have to add a rigidBody or Box Collider to the animated sprite myself?  Do I need to set up the collision boxes on the sprite in the Sprite Collection?

The Create Collider on the animation creates a box collider for the animation by default. This is to avoid any runtime collider creation - the animated sprite object doesn't know what animations are going to be applied to it, and as such, will not be able to work out if it needs a collider. Not all clips within one animation library will have colliders and you can even switch library at runtime, so the best solution for it was to let the user decide if the animated sprite needed a collider or not.

unikron

shaz68

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Reducing the number of animations created
« Reply #4 on: February 15, 2012, 11:27:36 pm »
Thanks for the info.  I did find a way to make the process a little faster than it was originally.