- Home /
Extend a line between two Vectors by a distance
So, say I have two vectors that define a line with X distance, and I want that distance to be Y, how could I do that?
I'm using Vector2.LerpUnclamped with a high t parameter, which does work for most of the cases, but because it multiplies the distance, if the distance between the vectors is really small, the result will also be relatively small, which is not what I want. I want a line that is based on the original, but extended to a distance.
Maybe I could extract the angle and create another end which is at the required distance, but I have no idea how to do that.
Any help will be greatly appreciated!
Your answer
Follow this Question
Related Questions
How to compare several distances? 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Make a dotted line from an object to the mouse 2d 2 Answers
How to know if my player is not moving? 2 Answers