Distance of a position from vector1 towards vector2

This is abit tricky to explain for me. So, I need to get the Vector that is lets say 500 units away from vector1 towards vector2, distance from vector1 to vector2 is not constant.

I can’t seem to figure out how to keep a constant 500 units distance from vector 1.

so you mean you want to create a fake line between vector1 and vector2 , and make a vector3 that is 500 units away from vector1 on the fake line between vector1 and 2.
I will see what i can do :slight_smile:

Well. Its called a trace, but yeah something like that.

Find the direction and multiply by distance.

The point of this thread is that i need to keep the 500 units distance constant, not depending on the distance between vec1 and vec2.

[editline]31st October 2010[/editline]

I don’t really need 500 units I just need something constant.

If you have a point aka a vector and this one vector has a direction which is also a vector, you multiply the direction of the point by your distance and add that vector to the point. You will get another vector which is always a distance of 500 from your point.

How would I go about getting the direction?

Uh, well what are you trying to do? if your trying to make a point in front of a player you can use GetForward()

[lua]
local vector3 = vector2+(vector2-vector1):GetNormal()*constant
[/lua]

Thanks