playMaker

Author Topic: [SOLVED] Triggering 2D Animation w/ PlayMaker - one last shot...  (Read 1878 times)

traitorjoe

  • Playmaker Newbie
  • *
  • Posts: 10
OK I've spent the last 36 hours trolling these forums and the internet for a way to trigger 2D animations in PlayMaker.

I've learned that it's a known issue that some people have found ways around, but there seems to be no clear or proven path.

I've also learned that PlayMaker is hoping to update their older tutorials and/or make new ones at some point... but in the mean time, would any one please mind sharing their step by step guide on how to make this work? There are easily 15 older threads on this topic, but none of them have any clear resolution.

My situation:
I have built several animations, created in the "Animation" pane with various tweened sprites. I have very complex PlayMaker game logic setting various states and such. I really need to be able to say from PlayMaker while in this state, play this animation. The states and such are no problem, but I just can't get the animation to fire, despite trying many many different solutions. I'm panicking a bit because I'm basically dead in the water on my project until I can get this figured out.

Any help is much appreciated!
« Last Edit: July 06, 2014, 02:38:15 PM by traitorjoe »

traitorjoe

  • Playmaker Newbie
  • *
  • Posts: 10
Re: [SOLVED] Triggering 2D Animation w/ PlayMaker - one last shot...
« Reply #1 on: July 06, 2014, 02:46:34 PM »
OK, I figured this out. Actually, I figured it out based on Brandon Wu's excellent One Month Game School called "Class 2: Make a 2D Platformer Game with Unity", which I highly recommend.

I want to post my solution here as to hopefully help other folks in the same situation.

First, I didn't understand that the Mecanim plugins were something I didn't have yet. I thought it was part of the standard PlayMaker bundle (not sure why it's not). That can be downloaded here: https://hutonggames.fogbugz.com/?W1031

Next, be sure there's an Animator component on the Game Object with the animations. I heard various sides of that coin... for this solution, I needed one. Name the states something short and appropriate.

After Mecanim is installed, there are lots of new PlayMaker actions. An awesome one is called "Animator Play". Add this and set it up to point to the GameObject with the animations. For "state", use the Animator state you named above.

Viola. Super simple, but I've seen a lot of folks beating their heads against the wall on this one just as I did over the past 36 hours - I hope this helps some folks.