Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to make Creating prefabs with a for loop in the editor

Discussion in 'Editor & General Support' started by mehmetalihanaydin0841, Jul 29, 2023.

  1. mehmetalihanaydin0841

    mehmetalihanaydin0841

    Joined:
    Feb 25, 2021
    Posts:
    1
    if (GUI.Button(new Rect(0, 0, position.width, 40), "Instantiate Prefab"))
    {
    Selection.activeObject = PrefabUtility.InstantiatePrefab(Selection.activeObject as GameObject);
    }

    There is such a code. As much as I want to use a loop How can I create a prefab?

    (I used google translate. I'm sorry if I'm wrong)
     

    Attached Files:

  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,295