playMaker

Author Topic: Set Property problem [SOLVED - OVERTURNED]  (Read 2989 times)

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Set Property problem [SOLVED - OVERTURNED]
« on: March 29, 2013, 05:27:49 PM »
I use EZGUI for text, I have an FSM with a Set Property on which I set the EZGUI text.

Everything works fine, but when I close Unity and reopen it, the connection to the EZGUI object/property is totally lost.

What's going on here?
« Last Edit: March 30, 2013, 11:14:49 PM by megmaltese »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: Set Property problem
« Reply #1 on: March 29, 2013, 06:18:09 PM »
Are you referencing a scene object from a prefab?

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Set Property problem
« Reply #2 on: March 29, 2013, 07:06:48 PM »
Yes  ::)

And the scene object referenced is a child of a prefab too  :-X
« Last Edit: March 30, 2013, 02:06:02 PM by megmaltese »

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Set Property problem
« Reply #3 on: March 30, 2013, 11:14:12 PM »
I managed to overturn the problem and the code is even more clear!  ;D

I have moved the SET PROPERTY action INTO the object that must be changed itself, and used the SEND EVENT to activate the state with the SET PROPERTY action!

Am I a genius?   :D

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: Set Property problem [SOLVED - OVERTURNED]
« Reply #4 on: March 31, 2013, 02:09:26 PM »
Yes  :D

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Set Property problem [SOLVED - OVERTURNED]
« Reply #5 on: March 31, 2013, 02:32:18 PM »
No really, that's the solution and it's ok.

But what if I HAVE TO reference a game object from a prefab?
Not possible?
Can you explain how to use it from prefabs?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: Set Property problem [SOLVED - OVERTURNED]
« Reply #6 on: March 31, 2013, 02:35:10 PM »
It's a limitation of Unity. Prefabs cannot save references to scene objects. So you need to find the scene objects at runtime and store them in vairables. You can find by name, tag, child of an object, raycast etc. it depends on the situation...

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Set Property problem [SOLVED - OVERTURNED]
« Reply #7 on: March 31, 2013, 08:49:36 PM »
OK, thank you  :)