Beginner Q - Getting Three Floats Rather Than One in my Distance Function

I followed the docs regarding making a function to find the distance between Points A & B

https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/Functions/index.html

When I run my game I’m getting three values via PrintScreen (as String) output:

0

329.84 (the distance between Point A & B)

0

I’m not sure why I’m getting the extra zeros (the tutorial doesn’t have them). By printing straight from the Break Vector node I have the same problem. Does breaking the vector simply zero out the other two vectors? How do I get just one value?

First substract one vector from the other (“Vector - Vector”), and then from the resulting vector out node, use “Vector Length”, that’s the distance between the 2 points.

Hi. I appreciate the help but I think you’ve misunderstood my question. I’ve worked out the distance between two points in 3D Space. I.E I have two vectors (A & B) eg xA,yA,zA and xB,yB,zB and have found the distance using D = Sqrt ( (Dx= (xA-xB)^2) + (Dy= (yA-yB)^2) + (Dz= (zA-zB)^2))

My trouble is that I’m getting the correct vector length, but also getting a junk 0 before and after (when printing the result to screen). For clarification check the link above which shows the graphs.

Well, it’s weird that you are getting 3 string values from a float, it might be a bug, or maybe you are using “Print String” on two more places that show something with the value of 0.

You should try getting the distance the way I’ve said, if you then “Print String” the float resulting from the “Vector Length” it will give you the single distance value you are looking for.