After you get your position from the spherical coordinates. You can now create facing.
// after you set your position using latitude and longitude.
var upVector = transform.position - planet.position;
var lookVector = Random.insideUnitSphere; // this could be a players position, or what not.
lookVector = Vector3.Cross(upVector, lookVector); // this will give you the right direction.
lookVector = Vector3.Cross(upVector, lookVector); // this will change the right direction back to the correct forward direction.
transform.LookAt(transform.position + lookVector, upVector); // now do the look using the offset
OK, nutshell…
Random.insideUnitSphere creates a random xyz that is inside a normalized sphere. this means that the distance from 0 of any given point cannot be more than 1. Remember, this is anywhere inside the sphere.
Cross takes two directions, and gives you the third direction. So, if you gave it a point facing right, and a point facing forward, your result is either up or down, depending on which you put first in the function. We use cross to take the odd random direction, and give a direction that is exactly perpendicular to the up vector.
We use the second cross, to transform the “right” vector back to the forward vector. Since these are simple quick multiplication methods, the calls are extremely quick.
Lastly, we simply use Unity’s power to align the object to the points that we want it to be. Adding the look vector to the position, gives us a relative position to the object we are placing on the planet.
I didn’t test this, but I think the worst would be a syntax error on Random.insideUnitSphere, and it could be a method, ( I dont remember off hand) and the Cross could be backwards. (flip the look vector and up vector on one of them.
Vector math is simple… think numbers…
if I am at 0 and I want to get to 10, then 10 - 0 is my effective direction. so 10. This means that:
target - current = direction