playMaker

Author Topic: An FSM that checks an animation is running  (Read 3313 times)

unearthly

  • Junior Playmaker
  • **
  • Posts: 62
An FSM that checks an animation is running
« on: December 07, 2016, 04:54:05 PM »
Hi

I want to make an FSM that can check if an animation is running and use it as a precondition to allow a subsequent animation to be activated by a button press.

Thanks in anticipation.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: An FSM that checks an animation is running
« Reply #1 on: December 07, 2016, 07:01:45 PM »
Hi,
If you use the animator you can use "PlayMaker Animator Fsm State Synch"


unearthly

  • Junior Playmaker
  • **
  • Posts: 62
Re: An FSM that checks an animation is running
« Reply #2 on: December 08, 2016, 04:09:19 AM »
Thanks for the reply but I am reluctant to use Animator.

The animations I have just need to be triggered at appropriate times. I have a gun idle animation which when running I want the player to be able to trigger related animations by button presses. However I don't want any secondary melee weapon animations to be so activated except when that weapons idle animation is running.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: An FSM that checks an animation is running
« Reply #3 on: December 08, 2016, 05:15:47 AM »
Hi,
What you want to do is best done in animator.

You can look to some unity animator tutorials and search for 'animator' in the playmaker actions to get/set a int/float/bool/.... which you can trigger with a button.

I used to do it also with animation actions until i learned how to use the animator.
after i learned it i had to redo several of my games...
But everything looks smoother now and works great.

unearthly

  • Junior Playmaker
  • **
  • Posts: 62
Re: An FSM that checks an animation is running
« Reply #4 on: December 09, 2016, 04:07:55 AM »
Hi djaydino,

I have used Animator a little but got discouraged having used it with poorly put together animations in the Animation part of Unity. Having then made my animations in a separate 3D program I thought it would be simpler to avoid Animator. But I can see there are a lot more Playmaker actions supporting Animator.

What I want to do can be condensed into two main objectives:

To change animations according to speed of the parent object.
To allow certain animations to play only after a particular animation has been running and no others (despite button presses which would otherwise activate those others)

So I should be able to use it to do the above? I will give it a go and hope you can help me again.

unearthly

  • Junior Playmaker
  • **
  • Posts: 62
Re: An FSM that checks an animation is running
« Reply #5 on: February 01, 2017, 06:23:44 PM »
Hi, looks like the Animator State Synchronization component might make it possible to directly attach my FSM to an animator state. However, I just updated my project to Unity 5.5.1 so will that component work in this version?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: An FSM that checks an animation is running
« Reply #6 on: February 02, 2017, 01:17:09 AM »
Hi,
If nothing special changed to the animator it should be fine, if you have problems you can submit a bug report.

You can find it in unity under Playmaker/Tools

unearthly

  • Junior Playmaker
  • **
  • Posts: 62
Re: An FSM that checks an animation is running
« Reply #7 on: February 03, 2017, 12:34:19 AM »
Thanks djaydino,

Animator State Synchronization does work in Unity 5.5.1 I can now disable the FSM's I wanted from running on particular Animator states. Very easy to use, solves a whole heap of problems. This can be considered solved. :)

HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: An FSM that checks an animation is running
« Reply #8 on: March 13, 2017, 06:40:07 PM »
where do I find this?  the download page says not to add it as it is included now, but I can't find it in the actions list

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: An FSM that checks an animation is running
« Reply #9 on: March 14, 2017, 04:50:56 AM »
Hi,
@HeathClose

I do not know what actions you are looking for?

the "PlayMaker Animator Fsm State Synch" is not an action but a component script.

Place the component on an object and drop in the fsm that you want to sync