Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: intrikit on September 19, 2013, 03:21:55 AM

Title: Animations Won't Play [SOLVED]
Post by: intrikit on September 19, 2013, 03:21:55 AM
Hello!

I've set up my state machine for my character as such:
(http://members.shaw.ca/session/playmaker_animation.jpg)

However, the animations associated to the states do not play. The Play Animation action greys out when the button is pushed. Any suggestions would be appreciated.

Thanks
Title: Re: Animations Won't Play
Post by: parallel on September 19, 2013, 05:54:17 AM
How are your characters animation import settings? I don't see any anim name specified. Legacy?
Title: Re: Animations Won't Play
Post by: intrikit on September 19, 2013, 02:29:51 PM
My character's rig was set to Humanoid. As were the animations. Then I got some errors saying that the animations needed to be set to Legacy. So I set both my character and the animations both to Legacy and with Store in Root. The errors went away and the Play Animation action in Playmaker was no longer greyed out but the animations still won't play..
Title: Re: Animations Won't Play
Post by: Alex Chouls on September 19, 2013, 04:35:54 PM
In the screenshot Anim Name is set to None. Are you setting the names of the animations to play?
Title: Re: Animations Won't Play
Post by: intrikit on September 19, 2013, 04:43:41 PM
Yes. I've made sure I set it to one of the animations in the animation list. It just so happened that it was set to "none" when I took the screenshot.

The states are applied to a game object though, not the actual character object. And the character is a child of the game object. Might that cause a problem?
Title: Re: Animations Won't Play
Post by: Alex Chouls on September 19, 2013, 04:46:43 PM
That shouldn't be a problem as long as you're targeting the right game object in the Play Animation action.

Do the animation names appear in the browse popup next to the Anim Name field?
Title: Re: Animations Won't Play
Post by: intrikit on September 19, 2013, 04:51:41 PM
Yes they do. Each time I add an animation to the Animation component of the character, the Anim Name field updates properly. My character should be good to go. It's rigged properly and I've applied animations to it via the Animator in Unity and it works.
Title: Re: Animations Won't Play
Post by: Alex Chouls on September 19, 2013, 05:05:49 PM
To try and debug this:

Add a new state with just the Play Animation action targeting the child object and make it the Start state. When you hit play does it play the animation?

If it does, then most likely something in the flow of your FSM is broken. E.g, the animation is playing but then another state is immediately stopping it, or playing a different animation...
Title: Re: Animations Won't Play
Post by: intrikit on September 20, 2013, 12:09:24 AM
Tried that... still won`t work! I must be missing some setting inside Unity.. I appreciate your replies!

Also, I am playing animations that I`ve either purchased or the ones that come free from Unity`s sample packages. I wonder if that is an issue.
Title: Re: Animations Won't Play
Post by: jeanfabre on September 20, 2013, 03:00:29 AM
Hi,

 have you tried with other animations? ones that comes free?

bye,

 Jean
Title: Re: Animations Won't Play
Post by: intrikit on September 20, 2013, 03:21:03 AM
Yes i`ve tried with about two or three other animations but none work. I actually also tried to apply the same FSM to the original model the animations are associated with and they also do not work...
Title: Re: Animations Won't Play
Post by: jeanfabre on September 20, 2013, 03:28:49 AM
uhm..

 can you start a fresh projects? if that still doesn't work, it's likely a setting you miss in general.


bye,

 Jean
Title: Re: Animations Won't Play
Post by: intrikit on September 21, 2013, 04:57:25 PM
I started a new project and still.. no luck.
Title: Re: Animations Won't Play
Post by: Alex Chouls on September 21, 2013, 09:38:23 PM
Does the animation play if you set it as the Animation in the Animation Component and check Play Automatically?
Title: Re: Animations Won't Play
Post by: jeanfabre on September 23, 2013, 01:42:53 AM
Hi,

 Can you share that fresh project? pm me, and I'll have a look.

bye,

 Jean
Title: Re: Animations Won't Play
Post by: intrikit on September 23, 2013, 03:04:05 AM
No it does not play.
Title: Re: Animations Won't Play
Post by: Alex Chouls on September 23, 2013, 07:18:24 AM
How are you making the animation? Have you made other animations that work in unity? It sounds like you might have art pipeline issues to figure out...
Title: Re: Animations Won't Play
Post by: intrikit on September 23, 2013, 11:40:49 AM
The thing is, I haven't made animations myself. I modelled and rigged the character, but I assumed that I could just use either free or purchased animations, which is what I've been doing. They do work properly whenever I add an Animator component to my character and throw in an animation in the state machine in Unity..
Title: Re: Animations Won't Play
Post by: Alex Chouls on September 23, 2013, 12:42:16 PM
Did you pm Jean the project? I'm not sure we're going to get any further without looking at your setup...
Title: Re: Animations Won't Play
Post by: intrikit on September 23, 2013, 01:17:27 PM
Yes I did! I appreciate your help. You guys are awesome.
Title: Re: Animations Won't Play
Post by: jeanfabre on September 24, 2013, 06:08:26 AM
Hi,

 Yes, I have it. Allow me somew time, I am in catch up mode... Please bump me beginning of next week if you haven't heard back from me, I would appreciate.


bye,

 Jean
Title: Re: Animations Won't Play
Post by: intrikit on September 24, 2013, 04:08:08 PM
will do
Title: Re: Animations Won't Play
Post by: jeanfabre on September 26, 2013, 02:55:53 AM
Hi,

 Ok, Something very important for anyone starting with Mecanim. It is quite a difficult beast to master properly for sure. So start in small incremental step and it's very important you read as much documentation as you can to get acquainted with the vocabulary and concepts. I had to go down that road too... :) You won't be able to hack Mecanim around...


animations can be of several types, if you start importing anims, you need to import them with type "humanoid" for them to be retargetable within mecanim. So select your anim, and in the "Rig" tab, pick "humanoid" for the animation Type, and click Apply.

Now that anim becomes possible to work with within your locomotion controller, and in states you can link now to that animation.

 Bye,

 Jean
Title: Re: Animations Won't Play
Post by: intrikit on September 30, 2013, 01:53:14 AM
does the Play Animation action not work with Mecanim? Are the custom actions listed in the wiki for the Mecanim package the only ones compatible with using Mecanim?
Title: Re: Animations Won't Play
Post by: jeanfabre on September 30, 2013, 01:57:36 AM
Hi,

 No, "play animation" is to play regular legacy animations, not mecanim. and Yes, as far as I am aware, the wiki page on mecanim is the only package that will give you access to Mecanim features.

bye,

 Jean
Title: Re: Animations Won't Play
Post by: intrikit on September 30, 2013, 08:45:59 PM
I see.. but we're talking animation-wise only, right? like, if i wanted to use Input actions that aren't listed in Playmaker Mecanim features, it will still work, correct?

I apologize these might seem like really basic questions but rest assured this stuff is all starting to make sense to me! ;D
Title: Re: Animations Won't Play
Post by: jeanfabre on October 01, 2013, 03:15:19 AM
Hi,

 Not sure what you mean here. User Input and Mecanim are completly separated, it's the job of the developer to bind both, so I guess the answer is yes.

 Mecanim is powerful, so yes, it takes a little while to understand it.

 Bye,

 Jean
Title: Re: Animations Won't Play
Post by: intrikit on October 01, 2013, 04:12:17 AM
thanks! yes i will watch all the videos.

i've been playing around with the actions and managed to get my player to walk, run, and face the proper direction in which it is heading. i attached a Smooth Follow Action to my camera to follow the character, however, with the Smooth Look At Direction Action, the camera also turns and faces the other way. This is supposed to be a side scroller so I want the camera to remain on the same side at all times. Any suggestions ?