Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: daplunk on April 23, 2014, 09:24:01 AM

Title: 2d Sprite Animation with Unity 4.3
Post by: daplunk on April 23, 2014, 09:24:01 AM
Hi Team,

I have searched high and low and I could not find an answer to this...

Does playMaker work with Unity 4.3 sprite animation features?

I'm not using anything else. The Play Animation function does not appear to do anything with 2D except tease me with the animation names in the Play Animation settings panels.

Any I missing something?

Title: Re: 2d Sprite Animation with Unity 4.3
Post by: xhidnoda on June 11, 2014, 11:05:59 PM
same here!
Title: Re: 2d Sprite Animation with Unity 4.3
Post by: Gav (HeyBud) on June 11, 2014, 11:57:51 PM
What worked for me was to set up animations in the Animator window. Use the Animation window to load your 2D sprite sequences into an animation clip. Then drag that animation Clip into the Animator. I then downloaded Mecanim playmaker actions. Use "Animator Play" instead. And point the action to your clip name in the Animator.

Maybe someone can help us figure out the Play animation Action on here, otherwise using Mecanim actions work.
Good luck.
Title: Re: 2d Sprite Animation with Unity 4.3
Post by: Alex Chouls on June 12, 2014, 02:04:58 AM
Unity is definitely moving towards using Mecanim to control all animations, so that's probably the way to go... but I'll investigate if Play Animation should work with 2d sprite animations...

Also check out this page on the wiki for more 2d actions:
https://hutonggames.fogbugz.com/default.asp?W1150
Title: Re: 2d Sprite Animation with Unity 4.3
Post by: xhidnoda on June 12, 2014, 12:43:16 PM
"Play animation" and "stop animation" and "pause animation" is not works for me.
I use 2D sprite.
When can find example of this?
Title: Re: 2d Sprite Animation with Unity 4.3
Post by: xhidnoda on June 12, 2014, 03:31:49 PM
Can anyone check and try this? I am away from my PC.

http://answers.unity3d.com/questions/581261/animations-suddenly-need-to-be-marked-legacy.html
Title: Re: 2d Sprite Animation with Unity 4.3
Post by: xhidnoda on June 12, 2014, 11:49:56 PM
nop...
https://www.youtube.com/channel/UCwYuQIa9lgjvDiZryUVtFGw
Title: Re: 2d Sprite Animation with Unity 4.3
Post by: jeanfabre on June 13, 2014, 08:28:12 AM
Hi,

 Are you sure the last link is what you wanted us to look at? Can you double check.

Can you elaborate on what you mean by "2d sprite animation". It could be many various solutions.

 As Alex mentioned, mecanim is totally the way to go in 99% of the cases. I strongly advice you do so too. If you are indeed using Mecanim then you will need this package (https://hutonggames.fogbugz.com/?W1031) to control your mecanim graphs with PlayMaker:

However, I just released a "PlaySpritesAnimation" action on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181), where you define your sprites, and the framerate, and the looping behavior and it will play these sprites, and send an event when animation is done  if loop is not infinite.


 Bye,

Jean

[EDIT (Alex Chouls): The action is also available to download below. NOTE: You must login to the forum to see download links.]
Title: Re: 2d Sprite Animation with Unity 4.3
Post by: szomaza on July 30, 2014, 01:44:15 AM
Hi,

Having the same problem of simply playing an animation on a 2D sprite not working brought me here.

I just tried the "PlaySpritesAnimation" action method to solve this but found a bug with that too. See attached image.

I will try the mecanim way of achieving this next. Keep your fingers crossed!  :-)

Br,
szomaza
Title: Re: 2d Sprite Animation with Unity 4.3
Post by: szomaza on July 30, 2014, 02:00:40 AM
The Mecanim way of playing an animation with the "Animator Play" action works nicely.

Br,
szomaza
Title: Re: 2d Sprite Animation with Unity 4.3
Post by: ninjapps on December 08, 2014, 02:16:55 PM
Hi,

I have added the Mecanim actions from here https://hutonggames.fogbugz.com/?W1031 since I am running on the same issue but I don't have the Animator Play action in Unity 4.6

What am I missing?

Title: Re: 2d Sprite Animation with Unity 4.3
Post by: jeanfabre on December 09, 2014, 12:46:09 AM
Hi,

 Please redownload, it will be there. I have corrected as well a inconsistent action "Set Animator Trigger", so if you get an error that it's duplicated , simply delete the "SetAnimationTrigger" file, as it should have been "SetAnimator Trigger".


 Bye,

 Jean
Title: Re: 2d Sprite Animation with Unity 4.3
Post by: ninjapps on December 09, 2014, 03:01:39 AM
Nevermind I saw the workaround by using the Play Sprites Animation action.
Title: Re: 2d Sprite Animation with Unity 4.3
Post by: tommy7788 on December 09, 2014, 04:50:58 AM
Thanks for the new actions. But how can I play a 2D Animation direkt?
For Example:
I have a car-animation. On the idle-animation the car stays. On the drive-animation the car drives from one point to another or do something else.
When I click on the idle-animation, how can I start the car-animation in playmaker?

Title: Re: 2d Sprite Animation with Unity 4.3
Post by: ninjapps on December 11, 2014, 10:51:20 AM
Hi tommy,

You can do this by using the Animator Play action, no need to use the arrows. Or if you want to use Animator for the workflow set some parameters to each aniamtion like a boolean and have playmaker change the boolean when you want the action triggered.

Also starting with Playmaker and its awesome once you get the hang of it!

Oh and if you dont have the Animator play action check this post as I was having the same issue. http://hutonggames.com/playmakerforum/index.php?topic=8952.msg42895#msg42895
Title: Re: 2d Sprite Animation with Unity 4.3
Post by: wpcapozzi on May 30, 2015, 09:55:11 PM
Thanks! Suggesting to use Animator Play helped me. Playmaker, Mechanim, triggers, and animations are now working very well for me.

I had been following an example that uses Set Animator Bool to change parameters, but for some reason it didn't work as in the example.

Animator Play works well!
Title: Re: 2d Sprite Animation with Unity 4.3
Post by: jeanfabre on July 20, 2015, 09:24:48 AM
Hi,

 make sure you set it back to false the next frame. Some mecanim setup ( most) will need you to simple use the bool as a one off switch, so don't leave it on always.

Bye,

 Jean