Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: joduffy on November 30, 2013, 08:31:34 AM

Title: Set parent action not working[SOLVED]
Post by: joduffy on November 30, 2013, 08:31:34 AM
Hi Guys,

I am getting this error when using the set parent action in playmaker:

Setting the parent of a transform which resides in a prefab is disabled to prevent data corruption.
UnityEngine.Transform:set_parent(Transform)
HutongGames.PlayMaker.Actions.SetParent:OnEnter() (at Assets/PlayMaker/Actions/SetParent.cs:38)
HutongGames.PlayMaker.FsmState:OnEnter()
HutongGames.PlayMaker.Fsm:EnterState(FsmState)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState)
HutongGames.PlayMaker.Fsm:UpdateStateChanges()
HutongGames.PlayMaker.Fsm:DoTransition(FsmTransition, Boolean)
HutongGames.PlayMaker.Fsm:ProcessEvent(FsmEvent, FsmEventData)
HutongGames.PlayMaker.Fsm:BroadcastEventToGameObject(GameObject, FsmEvent, FsmEventData, Boolean, Boolean)
HutongGames.PlayMaker.Fsm:Event(FsmEventTarget, FsmEvent)
HutongGames.PlayMaker.Actions.SendEvent:OnEnter() (at Assets/PlayMaker/Actions/SendEvent.cs:39)
HutongGames.PlayMaker.FsmState:OnEnter()
HutongGames.PlayMaker.Fsm:EnterState(FsmState)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState)
HutongGames.PlayMaker.Fsm:UpdateStateChanges()
HutongGames.PlayMaker.Fsm:Start()
PlayMakerFSM:Start()


Is this due to the new unity3d update?
Title: Re: Set parent action not working
Post by: Alex Chouls on November 30, 2013, 10:23:00 AM
It looks like you're trying to run it on a prefab reference. It will only work on a scene object...
Title: Re: Set parent action not working
Post by: joduffy on December 03, 2013, 09:30:51 PM
Thanks Alex,

I figured out the problem. I would create a gameobject from a prefab and then I wanted to set the parent of the created prefab.

The problem was I forgot to store the newly created gameobject so my set parent was pointing to the prefab instead.