How to point the bottom of a prefab at a point?

I made a custom gravity, and now I am having trouble making the character to go with it. I need to it to keep the bottom of the prefab pointed at the center of gravity(a Vector3).

Please use C#.

1 Answer

1

Not sure what you want. Here are a couple of ways:

transform.up = transform.position - centerOfGravity;

Another posibility:

v3 = centerOfGravity - transform.position;
transform.rotation = Quaternion.FromToRotation(-transform.up, v3) * transform.rotation;