// Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0)) { GameObject balle_GO = GameObject.Instantiate(m_Balle); Balle balle = balle_GO.GetComponent <Balle>(); balle.Shoot(transform.forward, 10f, 20); } }
void Update() { //Player shoot if (Input.GetKeyDown(KeyCode.Space)) { GameObject ballGO; ballGO = GameObject.Instantiate(m_Balle_Prefab, transform.position, Quaternion.identity); Debug.Log(ballGO); Balle ball = ballGO.GetComponent <Balle>(); ball.Shoot(transform.right); } }