playMaker

Author Topic: Mecanim Animator Fsm State synchronization  (Read 3416 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12098
  • Official Playmaker Support
    • View Profile
Mecanim Animator Fsm State synchronization
« on: December 05, 2014, 05:13:00 AM »
Hi,

 I can't track a previous post on this, tho I was sure I did post about it... anyway...

 I worked on a component that will synchronize Animator and Fsm together, so that within an fsm states will be activated to follow the exact process of an Animator.

--  Simply create state of the same names as the animator states you are targeting and you are good to go.

-- Same with Animator Transitions, simply name the state after the transition name or custom name and you are all set.

-- You don't need to include the layer name like "Base.xx", but if you have several layers you want to follow then it will be necessary, and you can choose what layer is the default within the component  ( 0 is the default).

I also made a quick video to show the basics, and there is a sample scene as well in the animator demo package.


 You can get it all on the wiki page

Bye,

 Jean

mdotstrange

  • Hero Member
  • *****
  • Posts: 548
    • View Profile
    • Can't code? Who cares! Make games anyway!
Re: Mecanim Animator Fsm State synchronization
« Reply #1 on: December 05, 2014, 07:30:11 AM »
Thats really useful! Thanks Jean!

I imported it into a clean project using the newest PM from the asset store with Unity 4.6 and I get the error in the attached screenshot-
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3181
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Mecanim Animator Fsm State synchronization
« Reply #2 on: December 05, 2014, 09:45:21 AM »
I think Jean probably used the beta version where this method was made public.

Jean, you should be able to access the method with reflection until it's made public in the next update...

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12098
  • Official Playmaker Support
    • View Profile
Re: Mecanim Animator Fsm State synchronization
« Reply #3 on: December 05, 2014, 09:49:38 AM »
Hi,

 Yeah... All day, I had this at the back of my mind.. Why did I not released this before?! now I know :)

 Anyway, I have repubished so that it's compatible with the current PlayMaker version.

 Please delete the PlayMaker Animator Examples, and re install. I will release the rest once 1.8 is out.

 Sorry about that :) I was too focused on doing these screencasts...

 Bye,

 Jean

mdotstrange

  • Hero Member
  • *****
  • Posts: 548
    • View Profile
    • Can't code? Who cares! Make games anyway!
Re: Mecanim Animator Fsm State synchronization
« Reply #4 on: December 05, 2014, 02:44:32 PM »
Ok  :)

Its an awesome addition btw- I'm looking forward to 1.8
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

MaDDoX

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 165
    • View Profile
    • FluidPlay Studios
Re: Mecanim Animator Fsm State synchronization
« Reply #5 on: December 10, 2014, 10:54:04 PM »
This is absolutely terrific, congratulations Jean! :)
--
Breno "MaDDoX" Azevedo
@brenoazevedo

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12098
  • Official Playmaker Support
    • View Profile
Re: Mecanim Animator Fsm State synchronization
« Reply #6 on: December 10, 2014, 11:46:44 PM »
Hey Maddox :) Hope you are well!

Thanks :) yes, I have to give credits to Paul Hayes :

https://github.com/paulhayes/AnimatorStateMachineUtil

And I took his concept and applied it to PlayMaker with some additional features, like you don't need to explicitly reference layers) and it understands transitions as well ( even custom named transitions:).

 The next iteration will allow you to have a state "xxx Ended" so that you can enter an fsm state when an animator state ended. I will also likely create a system to bind animator process with playmaker events.


 Bye,

 Jean

terrorOfNewDelhi

  • Playmaker Newbie
  • *
  • Posts: 9
    • View Profile
Re: Mecanim Animator Fsm State synchronization
« Reply #7 on: January 12, 2015, 01:28:46 AM »
Hi Jean,

I'm pretty new to PlayMaker (loving it, btw), but it seems to me that the last thing you mentioned - a system to bind animator process with playmaker events - would be incredibly useful.
Then you could control all rules and actions with FSMs, and simply set up the Animator states & transitions and have them follow the various FSM states.

Am I crazy, or would this be a good way of setting up animations?
And do you have any idea when you're likely to add this?

Thanks, and thanks again for an amazing tool.
Brendan

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12098
  • Official Playmaker Support
    • View Profile
Re: Mecanim Animator Fsm State synchronization
« Reply #8 on: January 12, 2015, 05:53:57 AM »
Hi,

 Right now you can already do this using the system I created, and in each state have a "send event". So you can do this, but yes, of course it would be great to do that from the component inspector directly.

I think you need to be careful with triggering animation in that context, instead animations should be trigger within mecanim, and fsm should follow the mecanim states to do the rest ( move the rigibbody, adjust the camera, etc).

 it seems to me that willing to go from mecanim to playmaker to finally trigger animations is uncessary, mecanim is self sufficient for this.

 Bye,

 Jean
 Bye,

 Jean

terrorOfNewDelhi

  • Playmaker Newbie
  • *
  • Posts: 9
    • View Profile
Re: Mecanim Animator Fsm State synchronization
« Reply #9 on: January 13, 2015, 02:15:35 AM »
Thanks for the reply Jean.
I'll have a think about it further. It's a bit of a moot point for what I'm doing right now, since I'm using a blend tree.

Zeldafreakneo

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Re: Mecanim Animator Fsm State synchronization
« Reply #10 on: July 16, 2017, 06:39:14 PM »
Where is this functionality now?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 1983
    • View Profile
    • jinxtergames
Re: Mecanim Animator Fsm State synchronization
« Reply #11 on: July 16, 2017, 07:38:24 PM »
Hi,
You can still get it on the animator proxy on the Ecosystem
But you should deselect all and only select :
Code: [Select]
PlayMakerAnimatorStateSynchronization
or you can download the attachment below and import.

stvbabb

  • Playmaker Newbie
  • *
  • Posts: 10
    • View Profile
Re: Mecanim Animator Fsm State synchronization
« Reply #12 on: July 31, 2017, 12:52:22 PM »
Hello,

Wow, I'm just now seeing this from Youtube and it's exactly what I need! Thank you!

And I hope you don't me replying in an old thread, but this is amazing.

Just one question, what is the syntax to get into a animation sub state?

So, i have a complex character controller with lots of animations, but in the layers it goes:

Base Layer
Upper Layer

in Upper Layer there is a 'Pistol' sub state machine. And within this sub state machine I want to use the state synchronization.

Is this possible?

And, syntax for the playmaker FSM states as:

Upper Layer.Pistol.Attack

Or

UpperLayer.Pistol.Attack

Or

UpperLayer.Attack

I can't figure it out.

Cheers, and thanks for the amazing playmaker work!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12098
  • Official Playmaker Support
    • View Profile
Re: Mecanim Animator Fsm State synchronization
« Reply #13 on: August 01, 2017, 02:30:14 AM »
Hi,

 good questions, I'll try to figure it out.

 Bye,

 Jean

stvbabb

  • Playmaker Newbie
  • *
  • Posts: 10
    • View Profile
Re: Mecanim Animator Fsm State synchronization
« Reply #14 on: August 01, 2017, 04:14:44 AM »
Hi Jean,

Awesome, thank you! I'll keep trying as well.