Hi again,
When assigning the enemy death explosion GameObject as a child of the ‘SpawnAtRuntime’ Gameobject through code, why do we have to do it like this: ‘explosion.transform.parent = parentGameObject.transform;’ ? I don’t understand why we have to use the ‘transform’. Why can’t we just do it like this: ‘explosion.parent = parentGameObject’ ?
We aren’t assigning the transform of the explosion GameObject as a child of SpawnAtRuntime, we are assinging the whole GameObject. So why the transform?
Thank you.