How do I obtain location of player relative to another actor?

I thought I should child the character to the actor, but I can’t get that working (I tried using the attach actor to actor node, attach component to actor node, etc.), if that is the solution please share how to add and remove the character from the actor during gameplay

Also open to entirely different solutions. Thanks :slight_smile:

You can simply store a reference to the other actor in your player as a variable and assign it in the editor. When you want to get the distance between them in your player, get the actor location of your player and the referenced actor, subtract the two vectors, and get the vector length of that.

If you want to access the distance from within the other actor, simple repeat the above steps but with Get Player Pawn instead of a variable reference.

For anyone in the future, use inverse transform location node to convert world space to local space

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.