Search Unity

recursive Instantiate will change prefab itself

Discussion in 'Scripting' started by Chien, Oct 18, 2010.

  1. Chien

    Chien

    Joined:
    May 1, 2009
    Posts:
    42
    Hi!
    I try to write a script to teach students to learn recursion, and find this odd thing:

    if I instantiate a gameobject itself and add the new object to its child, then the next time when I instentiate again, the gameobject will be cloned with all the new added children. Even I made a prefab and clone the prefab, it seems that it will modify the prefab. I want to create a fresh copy recursively. What shall I do? Thanks for the help!

    hsin-chien
    www.storynest.com
     

    Attached Files: