void Update() { cu = GetComponent <movimento>(); lado = cu.lado; if (Input.GetKeyDown(KeyCode.Mouse1)) { if (lado == true) { Instantiate(tir, r.transform.position, Quaternion.identity); } if (lado == false) { Instantiate(til, l.transform.position, Quaternion.identity); } } }
// Start is called before the first frame update void Start() { script = transform.parent.GetComponent <movimento> (); }