playMaker

Author Topic: Having problems with blending animation  (Read 3635 times)

brisck1

  • Playmaker Newbie
  • *
  • Posts: 40
Having problems with blending animation
« on: July 18, 2013, 07:06:07 AM »
So i've been getting to know Playmaker for a few days and have been recently looking into character animation in PM.

I looked through a few of the tutorials on playing animations in PM and it all seemed pretty straightforward using the Play Animation action, however I'm having issues with not being able to get the animations of my character to blend nicely between one another.

I Have a simple FSM set up on my character to play 3 animations, one after another in a loop, as a test, and between each animation state there is a 'jump' as it moves to the next animation rather than the nice blend that I was expecting.

I'm not sure what I'm doing wrong, but here is a picture of my FSM if it helps:



Note that I tried playing with the "Blend Time" of the Play Animation action, but increasing it just seems to make things worse...

Any help is much appreciated!

KozTheBoss

  • Full Member
  • ***
  • Posts: 150
  • You dont fail unless you give up trying to succeed
    • Pixel Life - portfolio
Re: Having problems with blending animation
« Reply #1 on: July 18, 2013, 04:06:11 PM »
I think this has something to do with the fact that you are only going to the next state (and playing the next animation) on "Finished" of the currently playing animation

Which in English means that it won't switch to the next animation before the currently playing animation is 100% done playing. Try setting up a "wait" action instead that switches to the next state after f.eks .5 seconds (making it switch to the next animation before the current animation is done playing)

Also, your animations are set to "stop all" playmode which will cause it to stop any other animations before playing the new animation, you could try setting it to "stop same layer" instead, which will only cause it to stop any animations in the same layer as itself, but any other animations will keep playing

I have no idea if any of this will help, but those are the 2 things I would try first

If you are looking for a way to play 2 animations at once (like running and shooting) then i made that work a little while ago by following this thread: http://hutonggames.com/playmakerforum/index.php?topic=1995.0

Best of luck to you, and welcome to playmaker :)
Remember, you don't fail unless you give up trying to succeed!

brisck1

  • Playmaker Newbie
  • *
  • Posts: 40
Re: Having problems with blending animation
« Reply #2 on: July 21, 2013, 01:22:58 PM »
Thanks for the advice! I tried all of your suggestions but am still no closer to solving the problem. I tried adding a wait of 3 seconds instead of using the finished state but no change, then I tried "Stope Same Layer" in the Play animation options, again with no change.

This is so frustrating as I seem to be doing everything correctly via playmaker but am just not getting any blending between animations at all.

Does anyone know if my animations have to be set up or imported in a specific way for it to blend?

I'm going to try animated character from the unity asset store to see if that makes any difference.


brisck1

  • Playmaker Newbie
  • *
  • Posts: 40
Re: Having problems with blending animation
« Reply #3 on: July 22, 2013, 06:38:10 AM »
Ok I seem to have made some progress in getting to the bottom of this. It seems that for the one-off animations that I want to play, like punching and kicking etc. you need to firstly give your animation a bit of 'lead-in' time for the animation to blend, in my case I just duplicated the first frame of the punch/kick animation for 4 frames before the animation begins. Secondly, to have the animation blend out at the end, I set the animation wrap mode in the inspector to 'Clamp Forever'.

Looping animations don't seem to have any issue blending as there are always frames for to blend through.

I need to do some more tests to see how this holds up but overall it's looking better. I thought I should share this for anyone else experiencing this problem in the future.

KozTheBoss

  • Full Member
  • ***
  • Posts: 150
  • You dont fail unless you give up trying to succeed
    • Pixel Life - portfolio
Re: Having problems with blending animation
« Reply #4 on: July 27, 2013, 04:17:42 PM »
Good progress! I haven't had any problems with blending one-off animations so far , though, but I will keep this in mind if I ever run into any problems :)
Remember, you don't fail unless you give up trying to succeed!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Having problems with blending animation
« Reply #5 on: July 28, 2013, 10:18:48 AM »
Hi,

 You should also study this example I made a while ago, it has a lot in there to cross fade blend mix anim to shoot while walking etc etc.

http://hutonggames.com/playmakerforum/index.php?topic=2267.msg10191#msg10191

bye,

 Jean