Hi everyone i made a script that spawning clones of some object but that is not spawning there where is my mouse can u help?
respawn - a field where we should click to spawn a object
dolar - object
public GameObject respawn;
public GameObject dolar;
private Transform trans;
private void Start()
{
trans = respawn.GetComponentInChildren<Transform>();
}
private void Update()
{
if (Input.GetMouseButtonDown(0))
{
dolar = Instantiate(dolar, new Vector3 (0,0,0), trans.rotation);
dolar.transform.parent = GameObject.Find("GameObject").transform;
}
}