Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Darkdevil79 on March 11, 2015, 04:45:03 PM

Title: Unity 5 AddChild Issue
Post by: Darkdevil79 on March 11, 2015, 04:45:03 PM
Hi all , I moved over to unity 5 and tried to use some of my code for a item to a gird , but I keep getting this error

Setting the parent of a transform which resides in a prefab is disabled to prevent data corruption.
UnityEngine.Transform:set_parent(Transform)
NGUITools:AddChild(GameObject, GameObject) (at Assets/NGUI/Scripts/Internal/NGUITools.cs:511)

I had a look around but I could not find any info , so i thought I would let everyone know

Title: Re: Unity 5 AddChild Issue
Post by: ArenMook on March 12, 2015, 08:23:17 PM
You need to instantiate the game object before changing its hierarchy. You seem to be trying to change the parent of an object that exists as a prefab.
Title: Re: Unity 5 AddChild Issue
Post by: Darkdevil79 on March 13, 2015, 01:16:02 PM
Thank you for the reply , I found out the error , I got the object mixed up (it was a late night coding) :-[ , so it was trying to add root 100 times

Not one of my finest monents