Move object around sphere

Hey there I want to achieve something like this:

A character which moves around a sphere. I found quite a lot of Super Mario Galaxy examples which also work fine in my game, however al of them use the unity physics. I would like to achieve this without the need of physics or raycasts etc.

Does anyone know how to calculate something like this ?

Well, I need raycasts to get the normal of the face the character is above. Other than that, itâ€™s just a matter of rotating the character so he is perpendicular to the normal, and set his transform.position to the hit.point of the raycast.

The following was originally for a vehicle script so feel free to play with the mechanics, especially what happens if the character is grounded or not.

``````private Quaternion rotCur;
private Vector3 posCur;
public bool grounded = true;
public LayerMask terrainLayer;//include the ground layer here and anything else that should act as ground

void Update() {
if(Physics.Raycast(ray, out hit, 1.5f, terrainLayer) == true) {

Debug.DrawLine(transform.position + transform.up * 1f, hit.point, Color.green);

rotCur = Quaternion.FromToRotation(transform.up, hit.normal) * transform.rotation;
posCur = new Vector3(transform.position.x, hit.point.y, transform.position.z);
grounded  = true;

}

if(grounded == true) {
//Lerp for smooth transition. transform.rotation and position could be set directly as well
transform.position = Vector3.Lerp(transform.position, posCur, Time.deltaTime * 5);
transform.rotation = Quaternion.Lerp(transform.rotation, rotCur, Time.deltaTime * 5);
}
else {
rotCur.eulerAngles = Vector3.zero;
transform.rotation = Quaternion.Lerp(transform.rotation, rotCur, Time.deltaTime);
}
}
``````