How can I possibly make a character’s bottom (ass) look at an object, like a sphere?
Let’s say we have the transform of the sphere and it is called ‘sphere’. Here are a couple of ways. They assume you’ve built the model so that the bottom is looking towards negative ‘Y’ when the rotation is (0,0,0):
transform.rotation = Quaternion.FromToRotation(transform.up, transform.position - sphere.position) * transform.rotation;
The rotation is a bit different, but you can try:
transform.up = transform.position - sphere.position;
Instead of using ‘ass’ as a reference, let’s use a chess Knight piece. You want the piece’s bottom, it’s base, to look at your target? Or you want the horse head’s back to look at your target?
I assume the first.
Even when you can calculate a single transformation for it, you can do it also in two steps that are maybe easier to understand.
First, make the piece’s mouth look at the target with
piece.transform.LookAt(sphere.transform);
Then, rotate the piece so that it lays on it’s back. With that, you will get its base to point to where its mouth was pointing before. To do so, you have to rotate the piece 90 degrees using the vector pointing to its right
as rotation axis.
piece.transform.Rotate(Vector3.right, 90);
or
piece.transform.Rotate(Vector3.right, -90);
Use the one that leaves the piece as you wish.