Q:

Shooting Bullets Around a Sphere

I currently have a ship that can orbit around a sphere freely controlled by a joystick. There is a separate joystick that controls the gun and starts shooting when it is touched.
Right now the bullets start shooting and then orbit the sphere until their lifetime has elapsed. Instead of having them orbit the sphere I want them to orbit for maybe the first half of their life and then shoot off into space. Does that make sense?
It would give the effect of a kind of glancing off the atmosphere, instead of staying in orbit for the whole time.
I am working in Unity3D and using the RotateAround() method to get the bullets to orbit. I'm thinking I need to take a snapshot of there position at half life, and then figure out the vector that would shoot them off into space. If someone could help me get going in the right direction with that, that would be great!

A:

I assume you have a separate routine that handles the behavior of the bullet, in which case you keep a timer variable(your halflife) that you reduce in the FixedUpdate method, and once it reaches zero then you change the behavior from doing a RotateAround to simply translating it according to the tangent to the planet multiplied by the current speed of the bullet, both of which you store at the instant that the timer ticks down to zero. 
The tangent vector should be essentially the current transform.forward vector of the bullet gameobject whereas the speed would be the arclength traversed divided by the delta time of the FixedUpdate(unless of course you already have some constant speed in radians/second that you multiply by the FixedUpdate elapsed time). Arclength/sec would be the angle(in radians) that the bullet rotates/second * the distance from the center of the planet to the center of your bullet(the radius).
Edit: I should mention that this will not work if you currently are utilizing the physics engine to handle any aspects of the motion which it seems you aren't from the way you phrased the question.
Implementation:
1)Create a public variable in the bullet routine to store 'speed' so that it can be set in the prefab of the bullet gameObject. Also have an escape time(or distance if you prefer) variable and a boolean to determine if it is still rotating or translating.
2)In the rotate phase of your update the radians to RotateAround should be (speed * elapsedTime) / radius of sphere
3)Once the escape timer(or distance) is reached, set the boolean flag to indicate that you are no longer rotating. Now simply use the transform.forward vector multiplied by the speed * elapsed time to translate the bullet.

