Making a new instantiated prefab as a child for existing GameObject
- by Akari
I've been searched about how to make these fruit to move as the basket movement if it collided with it, and I've been found that if I want to perform this I've to let these fruit to be a child to the basket game object .. for example :
banana.transform.parent = basket.transform;
banana and basket each of them of type "GameObject" ...
BUT unfortunately this way didn't work !! and I don't know why ??
So now I need to know if it is possible to destroy the banana if a collision with the basket happened and instantiate a new banana in the basket as a child at run time ?!!
I need to try this stupid way because I've tried all the other ways and nothing worked :(