How to make the front, left, right, or the back of a gameobject look at a target?

I have a gameobject that i have rotating around a target and i would like for the gameobject to face the direction of movement by making the left or right of the gameobject face the target when moving.

I have :

transform.LookAt(target.trasform.position);

to face the target and i found:

transform.rotation = Quaternion.LookRotation(transform.position - target.transform.position)

to face away from the target. Is there a way I can have the left and right sides of my gameobject face the target?

If you’re a beginner, perhaps the easiest ways to do this is:

  1. make it look at the target

  2. make it turn 90 degrees left or right, as you need

really that’s the best way … do it in two steps!

Hope it helps