// Update is called once per frame void Update() { if (Shooting) { Shooter.shoot(); Shooting = false; } }
// Update is called once per frame void Update() { rb.velocity = new Vector2(speed, 0) * Input.GetAxis("Horizontal"); if (Input.GetKeyDown(KeyCode.Space)) { shooter.shoot(rb.velocity); } }