How do I compare the rotation of an actor with the vector of a ray?

I’m trying to determine whether a line between two actors is equal to the rotation of one of those actors. The idea is to be able to be able to tell if certain actors are aligned with each other.

I’ve tried to do it with a ray trace, but it doesn’t really matter if the ray hits the actors, just that I can have the line to pull information from. If a ray trace is the best way, any suggestions on how to make it work? If there’s a better way, I’m all ears.

As long as you want the second object to be aligned along the first’s X, Y, or Z axis, you can for example find the Up Vector of your first object and then find the normalized line between the two objects. If they are equal or roughly equal, they should be aligned.

Use Up, Forward or Right Vector accordingly.

Thanks! How would you go about finding the normalized line between the two objects?

You can subtract their two locations and then there should be a “normalize vector” function.

Here’s the setup I have. I’m not getting the result I’m looking for. Maybe I’m missing something?

I swapped the top and bottom GetActorLocation nodes and it worked! I guess I’ll need to add in a way to get the inverse value. Thanks a ton!

No problem!