Cannot convert UnitEngine.Vector3 to UnityEngine.Transform when using .postition


I am trying to make a simple spawning system for my enemies. I have an array of all the spawnpoints, then when spawning a zombie I pick a random spawnpoint from this array, and instantiate a zombie there. The problem is, as soon as I do:

       Instantiate(zombiePrefab, selectedSpawn.gameObject.transform.position);

I get the error mentioned in the title. The spawnpoints are empty gameobjects.

look at the top of alll the ways you can type it in

the only one with 2 parameters needs a Prefab, and a Transform

you are putting in a Prefab, and a Vector3.

you can either do

Instantiate(zombiePrefab, selectedSpawn.gameObject.transform);


Instantiate(zombiePrefab, selectedSpawn.gameObject.transform.position, selectedSpawn.gameObject.transform.rotation);