playMaker

Author Topic: Handling Simple Animations  (Read 1659 times)

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Handling Simple Animations
« on: June 02, 2017, 07:01:13 AM »
Hello guys,

i thought of posting this to Unity Forums, but they are so complicated there, would probably get some script solutions and my animation in Unity knowledge is quite poor for now so i was hoping from some help from here.

I have a simple weapon switching animation which consists of weapon number 1 pulling into ship wing, and weapon 2 pulling out of ship wing.



There's only one weapon in the gif, but you get the idea.

Making a large number of animations for each weapon switch combination (there are almost 30 of them) is absurd and i'm sure that's not the way to go.

I basically need the object with sprite renderer which represents the weapon to move 10 pixels left until it is hidden, then swap sprite and move 10 pixels right. I'm also not sure if that's the right way to do it too.

Any meaningful ideas? I'm scared of Mecanim, haven't done anything with it yet.
Available for Playmaker work

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Handling Simple Animations
« Reply #1 on: June 02, 2017, 08:04:56 AM »
Hi,
Maybe this tutorial can help :


So you can set an event to swap the sprite :)

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Handling Simple Animations
« Reply #2 on: June 02, 2017, 12:27:58 PM »
Hi Djaydino, thanks, i'll check it out later tonight and let you know if it was helpful ans if i have some more questions :)
Available for Playmaker work

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Handling Simple Animations
« Reply #3 on: June 03, 2017, 07:51:08 AM »
I watched the tutorial, it was really helpful.

First i thought of doing it like this



That's just plain dumb, for 30 weapons it would require hundreds of animation clips.

But then i realized it's actually better to make two animations for every weapon, one for pulling the weapon in, one for drawing it out, so it totals 60 animations which is ok.



That way i can press the switch button, detect from the array what weapon is equipped and then activate the pull in animation for that weapon, and then detect what weapon is to be pulled out and play that animation.

I'll let you know how it goes, turns out there's no simple things when animations come to mind :D
Available for Playmaker work