Cannot set parent for instantiated GameObject. (Exception: Can't destroy Transform component of...)
I have player gameobject that is instantiated in the start of the game. I want to make pickable items to instantiate into the player gameobject's special zones (Marks), such as BowMark or QuiverMark. They are empty objects parented to the player gameobject rigs. The question is when i try to do that items gameobjects don't appear in the scene at all and after stopping editor playmode i have this exception:
Can't destroy Transform component of 'weapon_bow_ShenMin02'. If you want to destroy the game object, please call 'Destroy' on the game object instead. Destroying the transform component is not allowed.
Here is code sample:
GameObject bowMark = GameObject.Find("BowMark");
GameObject in3 = (GameObject)Resources.Load ("Prefabs/FlameBowE");
GameObject in4 = Instantiate(in3, bowMark.transform);
After few tests i figure out that problem is in parenting instantiated objects. Could anyone help with this situation please?