playMaker

Author Topic: Send event work in prefab but not in instance  (Read 89 times)

unclefour

  • Playmaker Newbie
  • *
  • Posts: 1
    • View Profile
Send event work in prefab but not in instance
« on: November 13, 2018, 05:56:15 AM »
Hi Guys, I got some issues when doing the prefab with playmaker. I checked many post but I still can't find ang solution.

So the story is,I need an enemy with some AI and animation, so I want put it as a prefab. Then I got a fbx model and I put it in to scene. Then I break the connection to the import model prefab and add a FSM. Then I drag this into asset and creat a New prefab with FSM. I have another object will send event to the model to start its FSM. And it doesn't work. But what I found is when I right click check the gobal event of prefab, it shows sent by other FSM, but nothing in the instance(all grey).

It looks like the send event action still work for my other objects, so what I thought I do something wrong when add FSM to a prefab model. However, I can't add FSM straight to the model prefab, there is error said this is a generated prefab. Can some one help me with this.

Best Regard.


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13635
  • Official Playmaker Support
    • View Profile
Re: Send event work in prefab but not in instance
« Reply #1 on: November 13, 2018, 11:38:12 PM »
Hi

yes, Fbx model assets are not prefab, you can only add fsm to a prefab asset.

your issue I think is that within a prefab you can not reference gameobjects outside a prefab hierarachy, as it will be lost. It's a Unity constrain.

So the solution is to get the reference of your prefab instance ( in the scene hierarchy) somehow.

if I am missing the point, can you describe some more or do a screencast or something? thanks :)

Bye,

 Jean