Get LookAt Rotation For a Single Axis

![alt text][2]

Updated question with more instructive visual aid:

I have 2 actors, which may have various shapes, sizes and lengths.

Actor A triggers an event. This event spawns a plane inside of Actor B, at a matching rotation to the static mesh of Actor B (the white cylinder.)

Actor A wants to perform a trace to find out the distance from A’s root (red sphere) to B’s Plane, along the length of A’s Static Mesh (White cylinder.)

The question is this:

B’s Plane needs to face towards Actor A, but can only add Relative Rotation on a single axis. Obviously, I won’t be able to aim towards A’s actual position, but to aim towards its XY world position (represented by grey column and pink text) would be enough.

How do I determine what local rotation to add to an actor component (on only one axis of rotation) so that said component faces towards a target position XY in world space on a particular axis? (Such that if both points projected lines as shown, they would intersect.)

I apologize. I’m fine with vector math itself, but once rotators start coming in and going out, I’m not quite there yet to be able to work this out without difficulty.

If the plane is in actor A, pointing at actor B, it can rotate around it’s own local Z, but not around A’s local Z, otherwise the plane wouldn’t point at B.

Does that make sense?

Original post edited so that it is more specific and precise about what I am trying to accomplish. Made this response confusing as the post itself is now easier to understand.

Hi - I read it again.

So the plane in B and the mesh have to face A, so it doesn’t matter which one we fix, the other will need to follow suit.

As far as I can see, to get B to point it’s gear at A’s XY it’s just a ‘look at rotation’ node, but only using the Z rotation of that.

Sorry, I meant MY reply was confusing, not yours (and that I edited it out to remove that confusion.)

Thank you, Clockwork. that did not solve the problem, but it made something unrelated click inside my head.

I just realized, this function is designed to make a specific part of the system as player friendly as possible (not that you can tell by my demonstration, but I promise lol.) It’s not actually needed to make anything WORK, but to make it more predictable as players learn the system.

And moments ago I realized… I already built a function that is more intuitive than what I needed this for, and if I just cut this function altogether, the entire thing is actually a lot simpler without losing any functionality.

So I wasted a whole day today, but it ultimately means the end result will be that much better for the decision to cut this.

I upvoted your reply as in some way, it made that realization click and I wanted to thank you for your time and effort. But this post technically doesn’t have an answer yet, and it’s a very niche math problem anyways.