Getting distance between two vectors in Blueprint?

Is there a way to get the distance between two vectors in Blueprint? All I can find is the get distance between actors. It would be really handy to get the distance between two vector variables.

Hey Charles,

You should be able to get the distance between two vectors with a vector subtraction node connected to a vector length node.

vsize.jpg

2 Likes

Skylar is correct.

And thanks for bringing to my attention that the vector math nodes don’t display the math symbols correctly. I’m reporting it.

1 Like

It would be nice to have a seperate node for distance between vectors…

2 Likes

I second this idea.

My free blueprint library has a node for distance between vectors:

This is also how i solved this, by creating a library function :slight_smile:

Cant use with 4.10?

What if I want to find a point (as a vector) between two vectors based on a float value between 0 and 1? How do I find that point?

The value between 0 and 1 will be derived from a timeline.

I believe you can Lerp these two vectors

I know it’s old but google thinks this is the most relevant when searching for this problem so here is my take:

“Get Point Distance to Segment”. takes 2 vector point as start and end of the segment and a 3rd one that you want to know the distance to.

2 Likes