r/UnityHelp • • Jan 07 '21

Please if see this please help

i follow a tutorial(on 2018.4 and visual studios 2017) where i am learning how to make a top down shooter but have encounter a problem: the tutorial tells me to type a line of code for invoke repeating with a refrence to a method but when i type it unity tells me that i cant use direct refrences to methods

4 Upvotes

5 comments sorted by

1

u/Danielk0926 Jan 07 '21

Brackeys, master of unity tutorials, has a unity tutorial on top down shooting.

2

u/meds737 Jan 07 '21

My problem with brackeys is that he uses moder versions of unity while i use 2018.4 (i dont want to imply that i dont like him it just doesnt work for me)

1

u/Danielk0926 Jan 07 '21

Ok can I see the code to see what the problem might be

1

u/meds737 Jan 07 '21

It will take me a minet to start visual studio then i wil l send it

1

u/meds737 Jan 07 '21

void Start()

{

InvokeRepeating("SpawnRandomEnemy", StartDelay, SpawnInterval);

}

void SpawnRandomEnemy()

{

int EnemyTypes = Random.Range(0, 3);

Vector3 SpawnPos = new Vector3(Random.Range(-SpawnRangeX, SpawnRangeX), -SpawnRangeY, SpawnRangeZ);

Instantiate(Enemys[EnemyTypes], SpawnPos, Enemys[EnemyTypes].transform.rotation);

}

//it tells me that the problem is in the fact that i reffrenced a method(also i cut out the not so important code from the comment)