normals + vectors issue

	surfaceNormal = gravityCentre.transform.position - transform.position;
	surfaceNormal.Normalize();	
	new_forward = Vector3.Cross(surfaceNormal, transform.right);

I am trying to get a character to walk around a sphere. I have realised this code has an issue in transform.right moves as I adjust the chacter which I believe is giving me issues. Is there a generic way for me to find transform.right?

Would this still work if I read off the the transforms y localrotation which should tell me which way the character is meant to be facing.

In my head I am thinking I know how much my character is rotated and i know the surface normal, now how can I use those 2 things to determine what the forward vector should be? I could just put it into a blank vector3(0,rotation,0) and normalise it, but no idea what to do next.

Please help me :):face_with_spiral_eyes:

I think such a method should work:

Inside Start mesure the angle between your character-sphere vector and any major direction in that plane. Move the character perpendicular to the character-sphere vector.
Inside Update again calculate the angle, rotate your character by that angle and move the character forward (its own forward).

Any chance of some snippets of code, I am not so good at vector math!

Something like this:

function Start(){
surfaceNormal = gravityCentre.transform.position - transform.position;
tempAngle=Vector3.Angle(surfaceNormal, Vector3.forward);
}

function Update(){
MoveForward();
tempAngle=Vector3.Angle(surfaceNormal,tempAngle);
transform.Rotate(Vector3.right *tempAngle);
}

So it works like move-turn-move-turn…