Using RotateAround to orbit a cube around a sphere, then setting up a projectile

I am having a hard time setting up a Projectile to come out of a cube (orbiting a sphere) correctly…imagine it as a detached turret…

Basically my issue is the projectile should be shooting out side of the cube (top of the cube, in accordance to its angle around the sphere). But my code just isn’t working, I am thinking perhaps my Quaternion idenity is off.

I am not sure what is going on, does the orientation of the view matter? Here is the code for the cube I have:

function Update () {
      transform.RotateAround (target.position, Vector3.right, 60 * Time.deltaTime);
      
      if (Input.GetButtonDown("Fire1")) {
 
			 var bullet = Instantiate(projectile, this.transform.position, Quaternion.identity);
			  bullet.rigidbody.AddForce(transform.up * 300);
			  bullet.gameObject.tag = "projectile";
			
		    
    }
}

Would it help if I got the image of the scene view here? is Transform.forward what I want maybe? (maybe I could align the cube when I place it in the scene and use the rotate around.)

figure out how to attach images :frowning: oh well…its a front on view, Z left and Y is up.

bumping :frowning: