LookAt() with X axis

I’m trying to use the LookAt(Target); function but the way I have everything set up, means that I need the X axis to look at the target and not the Z axis. I’ve had a look at lots of different forums but can’t find a proper answer. I need the object to have the X axis looking at the target instead of the Z.

thanks in advance


P.S. I don’t mind rewriting the lookat function so it works with the X axis if I have to but I don’t know how it works.

This should have all the information you need.