How do I rotate an object to face a direction.

I have a direction an an object and I would like to set the object’s rotation so that it will face the direction I have. How would I go about doing this?

If you want it to look at something in particular, try:

void Update() {
    transform.LookAt(target);
}

Where “target” is the object you want to look at.

If you want to just rotate the character, check out