I tried to Spawn The Drone At the Position of the spawn point But It doen not work??
public class Dronesspawn : MonoBehaviour
public Transform SpawnPoint;
public GameObject Drones;
public float spawnTime = 5f;
// Use this for initialization
InvokeRepeating("DronesSpawn", spawnTime, spawnTime);
// Update is called once per frame
void DronesSpawn ()
// I tried to Spawn The Drone At the Position of the spawn point ( The SpawnPoint Will Be moving!! ).But It Does not Work?
var newpDronesspawn = GameObject.Instantiate(Drones), SpawnPoint.transform.position,transform.rotation);
From the code you gave, the Instantiation doesn’t look quite right.
var newpDroneSpawn = (GameObject) Instantiate(Drones,SpawnPoint.transform.position,transform.rotation);
Given that you set up the references properly, this will instantiate a drone at the current position of the spawnPoint.
Pretty simple in C#:
public Transform Spawnpoint;
public GameObject Spawnobject;
Instantiate(Spawnobject, Spawnpoint.transform.position, Quaternion.identity);
Also when asking questions don’t say “it does not work”. Please be as specific as possible as people answering your question have no idea about what you’re seeing or your project.