Keeping object aligned with sphere.

I would like to have the player be able to walk on a sphere and one of the things involved with that is keeping the players feet on down toward its center. I have all of the script needed so far to get the vector for the player and other marked objects, but what I do need is the actual command to make that happen.

The command should align the objects’ local Y axis with the vector from the sphere. Here is an image to demonstrate:
1495201--83771--$grav_example.png

I’ve tried this, but it doesn’t let you look around very freely like you would otherwise(‘all’ being each of the objects around the sphere…‘downVec’ being the vector from the sphere to the object):

var ownPosition : Vector3;
function Start () {
	// Get Script Owner's Position Once
	ownPosition = transform.position;
}

function Update () {
	var Gravity = 9.8;
	var gravObj = GameObject.FindGameObjectsWithTag ("Gravity");
	for (all in gravObj){
		var allPos = GameObject.Find(all.gameObject.name).transform.position;
		var downVec = ownPosition - allPos;
        // Problem snippet
		all.transform.rotation = Quaternion.LookRotation(downVec);
	}
}

Also, what commands are there for applying a force to the objects to pull them toward the sphere?

Hey, couple weeks ago I’v worked on the same problem : )

This snippet code from my project for aligning player’s avatar along gravity vector:

...
        gravityVector.Normalize();
        Vector3 playerVector = transform.eulerAngles;
        playerVector.Normalize();

        transform.Rotate(gravityVector - playerVector);
...

So like this?

var ownPos : Vector3;
var Gravity : float;
function Start () {
	// Get Script Owner's Position Once
	ownPos = transform.position;
	ownVec = ownPos.Normalize();
}

function Update () {
	var gravObj = GameObject.FindGameObjectsWithTag ("Gravity");
	for (all in gravObj){
		var allPos = GameObject.Find(all.gameObject.name).transform.position;
		Vector3 allVec = allPos.transform.eulerAngles;
		allVec.Normalize();
		all.transform.Rotate(ownVec - allVec);
	}
}

I get the error “UCE0001: ‘;’ expected. Insert a semicolon at the end.
With this line: Vector3 allVec = allPos.transform.eulerAngles;