playMaker

Author Topic: Animator Send Event on Complete  (Read 7041 times)

KellyRay

  • Full Member
  • ***
  • Posts: 170
Animator Send Event on Complete
« on: June 11, 2014, 11:27:39 AM »
Maybe I am just dumb, but I can't seem to figure out how to get my events to trigger based on a finished animation like you can on the legacy animation actions.

Would be super cool to have that send event action on the animator side of things as well!

Thanks!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Animator Send Event on Complete
« Reply #1 on: November 07, 2014, 01:28:44 AM »
Hi,

 ok, you need to do the following.

-- add a "PlayMakerAnimatorMoveProxy" to your gameobject with the animator on.
-- use the action GetAnimatorCurrentStateInfo and record the variable "Normalized Time", when it's above 1, it means it reached the end, above, it's looping basically.

 I'll see if I can make a specific action for this that automatically do this work under the hood.

 this is the unity way btw, as there isn't a callback yet (afaik) for when an animation is ended on a state.

 Bye,

 Jean

KellyRay

  • Full Member
  • ***
  • Posts: 170
Re: Animator Send Event on Complete
« Reply #2 on: November 07, 2014, 11:52:05 AM »
Thanks Jean,

I've gotten around the issue by adding a wait action and then typing in the length of the animation from the inspector properties. I wonder if there is a way to make that apart of the action?

Kelly

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Animator Send Event on Complete
« Reply #3 on: November 11, 2014, 07:12:18 AM »
Hi,

 yeah you could do that but that's hardcoded and would be difficult to maintain and prone to bugs, as 6 month down the line you'll change that anim and forget to update the fsm with th enew clip length. I would always strive to find a solution that will work by itself.

 Also, keep watching for the up coming release of PlayMaker and my port of the Unity learn project "2d platformer", I am doing exactly the solution I proposed and it works well. I admit not as easy as an action drag and drop, I'll make an action for this ( I found what seems to be a good small framework to match an fsm state with mecanim states, that would be great if I can make that happen).

 Bye,

 Jean

SirGatlin

  • Playmaker Newbie
  • *
  • Posts: 17
Re: Animator Send Event on Complete
« Reply #4 on: December 15, 2014, 10:46:12 AM »
Is there any update on this action?


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Animator Send Event on Complete
« Reply #5 on: December 16, 2014, 02:28:44 AM »
Hi,

 yes, I have done this actually, thanks for bumping this thread:

Download it on the wiki page.

you can watch this video to see how it works 

Bye,

 Jean

SirGatlin

  • Playmaker Newbie
  • *
  • Posts: 17
Re: Animator Send Event on Complete
« Reply #6 on: December 20, 2014, 01:55:35 PM »
Awesome! it works so perfect, exactly what I needed.

here is a link to the video, some reason my browser wont play your embeded version.

Thanks so much Jean,
-g

Softme

  • Playmaker Newbie
  • *
  • Posts: 11
Re: Animator Send Event on Complete
« Reply #7 on: July 14, 2022, 09:03:40 AM »
It's been a long time, I just want to know is this Animator Fsm State Sync feature still work? I can't find it in playmaker editor or scripts :'(