From point A, Get the location X units behind B

Given the 2 locations A and B. How would you get the location of C ?
C being a point X units “behind” Point B from the direction of A?

ABCX

Sadly this has already seems to have been answered in 2016…

but the link to the answer has broken? and now points to an unanswered question about swarm…

Rubber Ducky Answer

ABCX_video

I created a BP with 3 cubes, Point A, B, C.

My method begins with putting the world location of A and B into a GetUnitDirection (Vector) Node.
You then multiply the return vector by the X units “behind” you desire.
This value must then be added to the world location of Point B.
I’m teleporting Point C to this location for demonstration.

Thanks pezzott1 for explaining

2 Likes

Get Unit Direction Vector gets the direction vector of length 1 that aims from A to B.

The scalar XUnits is offseting that vector by multiplying its value.

You then add the offsetted vector with the B wolrd location to place C.

Basical its: get direction from A to B and move X Units in that direction starting from B location.

2 Likes

Thanks friend. I’m going to throw in a bunch of search terms as this was a really difficult problem to search for.

Get location behind player from other character.
How to get a location behind an actor set distance away. Location behind player from point. Facing direction behind point. Facing direction behind actor. Find point behind other actor. Get a point distance away from another point. Find location behind character from another character.

This looks like problems to solve using the Dot Product. :wink:

2 Likes