Search Unity

Question How clone prefab as a new object ? not as (clone)(clone)...(clone)

Discussion in 'Prefabs' started by aramonh, Oct 4, 2022.

?

How clone prefab as a new object ?

  1. nothing to do

    1 vote(s)
    100.0%
  2. i dont know

    0 vote(s)
    0.0%
  1. aramonh

    aramonh

    Joined:
    Oct 4, 2022
    Posts:
    1
  2. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
    just set name of cloned instance after clone.
    Code (csharp):
    1.  
    2. var instance = Instantiate(resource, ...);
    3. instance.name = resource.name;
    4.  
     
    CodeSmile likes this.
  3. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,005
    I wonder ... does this have an effect on instantiating prefabs?

    upload_2022-10-4_12-0-14.png
     
  4. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
    As you can see it is editor behavior not runtime :)