OBJECT direction vectors

Hello everyone, hope you’re having a nice day.

My issue is i have a camera is looking at an object.

I want the object direction vector (up, forward, right) to changed based on the direction of the camera is looking into the object.

Exemple :

If the forward direction of the camera is looking at the object from it up direction the the object up becomes it’s forward and up becomes the forward.

I have manage find a way to do it but feels so dirty full of if’s.

I want to know if there is a better mathematical way to do it or at least if u can guide me to what i can research.

Thanks you in advance.

Not totally sure what you are trying to do but it’s not widely known that transform.forward can be set. That means you can write something like:

        transform.forward = target.transform.position;
        transform.LookAt(target);

You can do the same with transform.right etc. Does that help at all?