Answer the question
In order to leave comments, you need to log in
How to fix "Cannot instantiate objects with constant parent"?
Good day, gentlemen and ladies.
There was a problem creating the object.
The following script hangs on the character, which stores empty objects in itself:
public void WearClothes(StoreSlots storeSlots)
{
if (storeSlots.StoreEntity != null)
{
index = storeSlots.slotID;
if (storeSlots.accsesType == StoreSlots.Accses.Opened)
{
Instantiate(storeSlots.slotModel,_clothes[index].transform);
}
}
}
public void WearClothes(StoreSlots storeSlots)
{
if (storeSlots.StoreEntity != null)
{
index = storeSlots.slotID;
if (storeSlots.accsesType == StoreSlots.Accses.Opened)
{
GameObject cloth;
cloth = Instantiate(storeSlots.slotModel);
cloth.transform.parent = _clothes[index].transform;
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question