playMaker

Author Topic: Prefabs re-connected, still dont work  (Read 1342 times)

dshad44

  • Junior Playmaker
  • **
  • Posts: 55
Prefabs re-connected, still dont work
« on: July 11, 2017, 08:49:09 PM »
I know this question probably has been asked a thousand times on here, but any research I do on the topic is for people asking about how links get broken once prefabs are made.

Well, I still get issues all the time with prefabs that I have reconnected and still don't work.

What's the trick to getting them to work properly?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Prefabs re-connected, still dont work
« Reply #1 on: July 11, 2017, 11:17:47 PM »
Hi,
You can't connect to a prefab in you project folder directly.
You can if you place the prefab into the hierarchy in editor mode and then connect to it.

If you create @ runtime you need to use the Get/Set FSM actions and "Send Event By Name" action.
just search for fsm and you will see a whole list of them :)

Btw, this is a Unity limitation not a Playmaker limitation :)

dshad44

  • Junior Playmaker
  • **
  • Posts: 55
Re: Prefabs re-connected, still dont work
« Reply #2 on: July 12, 2017, 09:07:11 PM »
Thanks for the reply!

That's probably why when I test everything with the objects in the hierarchy, the game works fine, but when I make them Prefabs, the game stops working.

I have on FSM telling another FSM to destroy itself, but they don't seem to be communicating. Should I use Set FSM Game Object to get the commanding state talk to the right GO?
Or should I use Get FSM Game Object on the subordinate state so that it receives the command?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Prefabs re-connected, still dont work
« Reply #3 on: July 12, 2017, 10:34:04 PM »
Hi,
if you made a prefab from the objects and don't remove them from the hierarchy they should still be connected,
But if you would remove them and replace them with the prefabs or if you would place them in a new scene the will indeed break.

also if you would create them @ runtime.

Many thing depends on what you do,
Are the GO's Created @runtime?
if so you can store them into a variable or array to communicate with them.
or are you placing them into different scenes?
then you could parent them to a empty object and make that as a prefab.

Maybe you can show some pictures from what you are trying to do :)