playMaker

Author Topic: SendEvent string function missing?  (Read 2066 times)

OnyxRook

  • Playmaker Newbie
  • *
  • Posts: 7
SendEvent string function missing?
« on: May 23, 2014, 03:16:53 AM »
Hey guys,

I've been using Playmaker a ton lately, and I really love it! I'm actually in the middle of building my own custom AI and largely it's been going very smoothly. Unfortunately today I ran into a little issue regarding animation events. I actually think I'm running into the same problem that someone on another thread ran into http://hutonggames.com/playmakerforum/index.php?topic=1411.0 (second post from the last), but they never followed up so there was no resolution.

Basically, I'm trying to trigger a sound via an animation event. I found the instructions on how to do this in the manual and was able to set it up without any issue on a test mesh (the same mesh as my AI, but without any of the FSMs on it). However, when I went to try and recreate the exact same scenario on my AI, the animation event function list was significantly shorter than it should be....and SendEvent(string) wasn't among the group. I tried fiddling around by deselecting objects, switching to different FSMs, pretty much anything, and on a couple of occasions I was able to get the full list to appear, but whenever I switched back to the FSM that I wanted to govern the sounds, the function would get the (function not supported) note added. I tried restarting Unity a couple of times...no dice. Always the same issue.

Attached is a screenshot of what I mean.

Any ideas as to what's going wrong? It works beautifully on my test object, so I don't want to have to give up on it!

Thanks!!

OnyxRook

  • Playmaker Newbie
  • *
  • Posts: 7
Re: SendEvent string function missing?
« Reply #1 on: May 23, 2014, 05:05:57 PM »
Just a quick update! Still no luck setting this up on my AI proper, but I've been able to create the FSM on a test object and then transfer it over to my AI as a template. It's kind of a hassle, but at least it works!

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: SendEvent string function missing?
« Reply #2 on: May 23, 2014, 07:49:51 PM »
Do you have multiple PlayMakerFSMs on the GameObject?

There's a limitation in the Unity Editor that doesn't list component methods if more than one of that component is on the GameObject.

You could restructure your setup so there is only one PlayMakerFSM on the target GameObject. Or you could create a small router script on the GameObject to forward the events to the PlayMakerFSMs. Let me know if you need a hand making that script...

OnyxRook

  • Playmaker Newbie
  • *
  • Posts: 7
Re: SendEvent string function missing?
« Reply #3 on: May 23, 2014, 08:11:47 PM »
Hi Alex!

I do have multiple FSMs on my AI (loosely following the BadSeedGames tutorial linked on the Playmaker youtube channel), so that explains it.

I'm intrigued by the concept of the router script! Could you expand on that a little more?