playMaker

Author Topic: Sending animation event to other game objects  (Read 7181 times)

Krillan87

  • Beta Group
  • Full Member
  • *
  • Posts: 185
Sending animation event to other game objects
« on: February 13, 2017, 10:08:29 AM »
Hi!

I just have a quick question. Is it possible to send an animation event to a object that is not on the game object that has the animator component?

In my case I have a FSM on a child that would like to use a animation event (the parent got the animator component).

Is this possible or do I just have to put the FSM on the parent instead of the child?

thanks!

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Sending animation event to other game objects
« Reply #1 on: February 13, 2017, 03:30:04 PM »
Make a global event and put it in the fsm that is on the animated object.
Available for Playmaker work

Krillan87

  • Beta Group
  • Full Member
  • *
  • Posts: 185
Re: Sending animation event to other game objects
« Reply #2 on: February 13, 2017, 05:07:29 PM »
Make a global event and put it in the fsm that is on the animated object.

I do not think I fully understand what you mean. So I should just make a placeholder FSM on the animated object, and in that FSM make a global event? I tried that and I did not manage to get it to work.

(I've used animated events a lot before, but all of them are on FSM that are one the same object as the animator component. In this case the FSM is on a child and the animator component is on the parent.)

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Sending animation event to other game objects
« Reply #3 on: February 14, 2017, 12:47:24 AM »
I'll post an example when i get to the computer.
Available for Playmaker work

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Sending animation event to other game objects
« Reply #4 on: February 14, 2017, 12:55:51 AM »
Hi,
Yes you can.
Any action that has "Game Object" you can change to a different object,
just click on 'Use Owner' and select 'specify Game Object' then drop in the game object you want to use for that action.

Krillan87

  • Beta Group
  • Full Member
  • *
  • Posts: 185
Re: Sending animation event to other game objects
« Reply #5 on: February 14, 2017, 02:31:25 AM »

Hi
Yes you can.
Any action that has "Game Object" you can change to a different object,
just click on 'Use Owner' and select 'specify Game Object' then drop in the game object you want to use for that action.

Hi.,

Thank you for your answer.
Yeah yeah I know that I can change from "owner" to game object" in a action. I think am not being clear in what I'm trying to accomplish here. I'm talking about animation events (https://hutonggames.fogbugz.com/?W181)

You know, events that triggers in a certain frame of a playing animation. In the description in the link i posted above the following can be read:

"You can use animation events to trigger transitions in a Playmaker FSM on the same Game Object as the animation:"

So my conclusion is that it does not work on a child, but was just curious if anyone could confirm that is the case. (Or know a way "around" it)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Sending animation event to other game objects
« Reply #6 on: February 15, 2017, 01:36:20 AM »
Hi,
Yes the event works only on the object where the animator is on,
but what you could do maybe is :
In the fsm on the object with the animator inside the state that you will trigger, use a send event and from there you can trigger to any fsm.

Krillan87

  • Beta Group
  • Full Member
  • *
  • Posts: 185
Re: Sending animation event to other game objects
« Reply #7 on: February 15, 2017, 02:52:48 AM »
Hi,
Yes the event works only on the object where the animator is on,
but what you could do maybe is :
In the fsm on the object with the animator inside the state that you will trigger, use a send event and from there you can trigger to any fsm.

Hmm... yeah i guess that could work, gonna try it, thanks!

The thing is that I'am trying to organize my FSMs in a better way other then just dumping all of them on the "main object". So my idea was that I created empty game objects and sorted my FSM by functionality. So one game object with only handles experiancepoints/skills and one that handles Hp/man/Health and so on...

It was here that I realized this problem because some FSM NEEDS to be on certains game objects for them to work.

Maybe I should create a new thread discussing how people organaize their work.

thanks for all help, man! really nice of you!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Sending animation event to other game objects
« Reply #8 on: February 15, 2017, 06:38:30 AM »
Hi,
I usually make an empty object named 'game manager' and then i have empty child's called (for example) 'score manager', 'gameflow manager', 'ai manager', 'level manager', and so on
and have the needed fsm's in there.

Then for (for example) character movement is use on the character itself or in a parent empty object.
also for ai movement i do this most of the time.