playMaker

Author Topic: Animating Sprites [SOLVED]  (Read 2589 times)

MarkD

  • Full Member
  • ***
  • Posts: 113
Animating Sprites [SOLVED]
« on: May 10, 2016, 11:56:06 AM »
Hey guys,

My question is about efficiency with animating sprites.

The artist I'm working with is creating a few objects that will animated by flipping through several sprites.  For example, the campfire object will be 5-10 sprites. Setting up an FSM to flick through each sprite (turning one off and another on) will be super simple, but I wonder if there's a better way out there that might be more efficient in terms of performance? 


« Last Edit: May 10, 2016, 04:58:43 PM by MarkD »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3998
  • Official Playmaker Support
    • LinkedIn
Re: Animating Sprites
« Reply #1 on: May 10, 2016, 12:28:59 PM »
You should make an animation from the sprite sheet and then use an Animator or Animation component to play the animation.

Here's a good tutorial:
http://www.strandedsoft.com/using-spritesheets-with-unity3d/

You can setup a Mecanim state machine for the animations then use the Mecanim Animator actions to control them:
https://hutonggames.fogbugz.com/default.asp?W1031

(Note, the Animator actions will be integrated in Playmaker in the next update)

MarkD

  • Full Member
  • ***
  • Posts: 113
Re: Animating Sprites
« Reply #2 on: May 10, 2016, 03:17:13 PM »
Excellent - thank you for this!

Just so I understand more clearly, why is this method preferred?  Performance? Ease of use?  Better control over timing?  All of the above? 

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3998
  • Official Playmaker Support
    • LinkedIn
Re: Animating Sprites
« Reply #3 on: May 10, 2016, 03:36:48 PM »
All of the above really. A state for every sprite frame (if that's what you were thinking) is overkill and would be hard to tweak. Better to use Unity's animation tools unless you have a very specific reason to control every frame.

MarkD

  • Full Member
  • ***
  • Posts: 113
Re: Animating Sprites [SOLVED]
« Reply #4 on: May 10, 2016, 04:58:55 PM »
Roger that - and thanks again!