void Shoot() { GameObject cb = Instantiate(cannonBall, barrel.position, barrel.rotation); CannonBall cbScript = cb.GetComponent <CannonBall>(); cbScript.speed = ballSpeed; cbScript.GoFast(); }