face forward if direction is going right

I’m trying to create a dynamic ledge script.

What i want to achieve is this.

the red arrow is the direction of movement…
i want the character to face towards the cube.

how do i achieve this?

You can use the character’s transform and take the negative of the transform.right vector.