Would it be possible to change the parent of an instanced object in unity?

81 Views Asked by At

Would it be possible to change the parent of an instanced object in unity?

Generally my thought is that it would be just the same as any other GameObject.

myObject.transform.SetParent(newParentObject.transform);

But I thought there may be special rules for cloned objects because you set the parent in creation of the instance object. Do they have rules (what are they) or is it the same?

1

There are 1 best solutions below

0
On

Yes, you can. It is the same code. (Just asked an old friend) so if someone needs to know:

myObject.transform.SetParent(newParentObject.transform);