Hi all,
I have a score counter in my game I want to Instantiate a new gameobject while score was increased by 1
my code is
public static int score;
`void Update () {
score = move.count;
if(score>=spawnTime)
/
SpawnRandom();
}` ,
public void SpawnRandom()
{
direction = new Vector2 (-4.41f,1.99f);
randomNumber = Random.Range (1, 3);
switch (randomNumber) {
case 1:
white= Instantiate(apple,direction,Quaternion.identity);
//
break;
case 2:
Instantiate(red,direction,Quaternion.identity);
break;
}
}