playMaker

Author Topic: Loosing SetParent param from original PrefabFSM on CreateObject  (Read 2098 times)

psypol

  • Playmaker Newbie
  • *
  • Posts: 39
Loosing SetParent param from original PrefabFSM on CreateObject
« on: January 19, 2014, 03:02:58 PM »
hello

i have a prefab working as i want and his FSM too.
now when i use CreateObject to create other instances of this prefab in my scene...

its seems that the parameter "Parent" from "SetParent" Action is turned to
'None'.
(it "forgets" about what i fine tuned in my original prefab :-( )

Any idea why the original parameter from the prefab is not copied ?
is there a special rule that forbids to copy a parent of a prefab ?

psypol

  • Playmaker Newbie
  • *
  • Posts: 39
Re: Loosing SetParent param from original PrefabFSM on CreateObject
« Reply #1 on: January 19, 2014, 03:25:39 PM »
i tried to use only prefabs as parents (cause i was able to select them as parent in the prefab at least ...)

but the only thing i managed to obtain is this error message :

Quote
Setting the parent of a transform which resides in a prefab is disabled to prevent data corruption.

psypol

  • Playmaker Newbie
  • *
  • Posts: 39
Re: Loosing SetParent param from original PrefabFSM on CreateObject
« Reply #2 on: January 19, 2014, 03:53:19 PM »
tried also to pass the proper parent to the prefab FSM instance via 
"Set FSM Game Object" but the same error occur.

Now the only thing i see is to NOT have the object as a prefab to solve my problem

please help :-)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Loosing SetParent param from original PrefabFSM on CreateObject
« Reply #3 on: January 21, 2014, 06:59:29 AM »
Hi,

You can't reference a gameobject from the scene within a prefab, only something within it's own hierarchy, that's a Unity constraint.

 you have to find another way to get a reference of that gameobject, either using find ( not recommanded), or something during the instantiation of the prefab and sned it an event with a reference of that gameobject.


Bye,

 Jean