Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

how to instantiate more enemies in unity

void Update()
    {
        if (name1 == 0)
        {
            name2 ++;
            int i = name2;

            while (i > 0)
            {
                x = Random.Range(-8.03f, 8.07f);
                y = Random.Range(4.21f, 1.66f);

                Instantiate(name1, new Vector2(x, y), name1.transform.rotation);

                i--;

            }
            enemynumbers = lvl;


        }
        

    }
 
PREVIOUS NEXT
Tagged: #instantiate #enemies #unity
ADD COMMENT
Topic
Name
4+8 =