playMaker

Author Topic: Anim Events - Send Event  (Read 3895 times)

SeanC

  • Junior Playmaker
  • **
  • Posts: 61
Anim Events - Send Event
« on: July 30, 2012, 04:23:02 PM »
It would be awesome if the SendEvent function in the anim events could target specific GameObects, specific FSMs and Broadcast all. As it is now, you have to send the event to the object that has the animation and then trigger an event from there. If these options existed you wouldn't need to clutter up your actor with FSMs

Thanks!
Sean

SeanC

  • Junior Playmaker
  • **
  • Posts: 61
Re: Anim Events - Send Event
« Reply #1 on: August 07, 2012, 12:38:31 AM »
Hey guys,

Could we get it so the "send event" in the anim events ca target a different game object, other than the one contaning the animation? Every time I reexport my model (which has the anims hooked up to it via the model@animation method) I lose all components that were added. In order to maintain the prefab link with the FBX file, unity essentially overwrites your prefab every time you reexport it, which means all components are lost and have to be rebuilt. It's a severe shortcoming on the pipeline of Unity, but nonetheless, if the anim events could pick a different target (object, FSM, broadcast all) that would circumvent the issue.

http://answers.unity3d.com/questions/15271/prefabs-workflow-changing-models-in-a-3d-app-after.html

http://answers.unity3d.com/questions/8838/how-can-i-keep-the-prefab-connection-when-re-expor.html



Please let me know what you think,
Thanks,
SeanC

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Anim Events - Send Event
« Reply #2 on: August 07, 2012, 09:31:44 AM »
Hi,

 I think you need to store the gameObject target in a fsmGameObject variable, and when your prefab gets instantiated in your scene, inject the gameObject target in question. you can't reference scenes gameObject from a prefab, nothing we can do about it currently unfortunatly.

bye,

 Jean

SeanC

  • Junior Playmaker
  • **
  • Posts: 61
Re: Anim Events - Send Event
« Reply #3 on: August 07, 2012, 03:17:58 PM »
Quote
I think you need to store the gameObject target in a fsmGameObject variable, and when your prefab gets instantiated in your scene, inject the gameObject target in question

I am currently doing that, but that's not quite what i'm talking about. I'm referring to events that are placed inside an animation, in the animation editor. Specifically, the "SendEvent" function within that.




That function can only send events straight back to the object which contains the animation, which means, my character has to have an FSM listening for these events, which means i have to place those components on the prefab (regardless of how i bring it in to the scene). But every time I reexport my FBX, it wipes out all the necessary Playmaker components and I have to set them up again so my anim events have something to send to.

What would solve this would be, having the ability to select specific FSMs to target with the "Send Event" function in the anim events, or to broadcast the event. So, for example, under the string parameter in the "Edit Animation Event" dialog box, there would be a "Target" option, which could pick an FSM or Broadcast All. This way, we can remove the need to have an FSM component exist on a model, simply to listen for an event and send another event based off of it.

SOLUTION MOCKUP:


I suppose the other solution would be to have a dummy object hold the necessary FSMs, and apply them to the character at runtime, but that seems like a messier solution.

Does that make any sense? Is there a way to do this that maybe I missed?

Thanks a lot Jean,
Sean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Anim Events - Send Event
« Reply #4 on: August 09, 2012, 05:00:18 AM »
hi,

 I'll need to get my head around that and run some tests. Right now I don't really see how to adapt to this case. Some small framework would likely be the way out of this really.

 bye,

 Jean