I have a game object that is a globe. I am putting different game objects on them with latitude and longitude coordinates. It works when the equator meets the prime meridian is passed in as (0,0,1). However, if I rotate the globe and put a new object on it, the latitude and longitude are calculated as if the globe has not been rotated. Is there a way to have it use a certain point regardless of rotation. Or is there a formula that will convert to the original point? Or there might be a different way that I am not thinking of. Any ideas?

Maybe I could rotate it back, place the object, then correct the rotation?

You’ll need to transform your resulting position into the object’s local space, but it’s tough to advise you how to do that without seeing your existing code.

@StarManta

public GameObject game;

public Transoform Parent;

Vector3 coordinate;

float latitude;

float longitude;

Vector center = parent.transform.position;

Instantiate(game, new Vector3(parent.position.x, parent.position.y, parent.position.z), Quaternion.identity);

game.transform.parent = parent.transform;

coordinate = Quaternion.AngleAxis(longitude, -Vector3.up) * Quaternion.AngleAxis(latitude, -Vector3.right) * new Vector3(0, 0, .25f);

coordinate += center;

instead of: coordinate += center;

use: game.transform.TransformPoint(coordinate);

@bigmisterb that didnt work

I ended up rotating it back to the original position, setting the icon, and then rotating to expected position. Seems to work but I’m not sure this is the best way.