playMaker

Author Topic: Set parent action not working[SOLVED]  (Read 2713 times)

joduffy

  • Full Member
  • ***
  • Posts: 121
  • Here to help
    • View Profile
    • Online Playmaker Courses
Set parent action not working[SOLVED]
« on: November 30, 2013, 06: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?
« Last Edit: December 04, 2013, 02:49:47 AM by jeanfabre »
- Jonathan

Online Playmaker Courses available at:
http://courses.jonathanoduffy.com

“I want the world to be a better place because I was here.”  -  Will Smith

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3632
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Set parent action not working
« Reply #1 on: November 30, 2013, 08:23:00 AM »
It looks like you're trying to run it on a prefab reference. It will only work on a scene object...

joduffy

  • Full Member
  • ***
  • Posts: 121
  • Here to help
    • View Profile
    • Online Playmaker Courses
Re: Set parent action not working
« Reply #2 on: December 03, 2013, 07: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.
- Jonathan

Online Playmaker Courses available at:
http://courses.jonathanoduffy.com

“I want the world to be a better place because I was here.”  -  Will Smith