change the length of the vector

hi, i tried to change the length of the vector using Vector3.Scale and it seems that it didnt work, here is the code is used:

//CALCULATE THE END POINT OF THE LINE
MicroLabel_.endPoint=direction+MicroLabel*.startPoint;*_ 
<em><em>MicroLabel_.endPoint=Vector3.Scale(MicroLabel*.endPoint,Vector3(0.2,0.2,0.2));*_</em></em>
<em><em>_*```*_</em></em>
<em><em>_*<p>it messes up the direction. so the question is how to make vector smaller or bigger in length*_</em></em>
<em><em>_*and not mess the direction in the process? i cant seem to figure that out. also i would like to be somehow connected to the camera.distance so that labels and lines stays inside the viewport..any ideas?</p>*_</em></em>
<em><em>_*<p>thanks!</p>*_</em></em>

Based on the nomenclature you are using (start point, end point), it appears you are scaling the wrong value. Scaling the direction is what you should be doing. Something like:

Vector3 scaledDirection =Vector3.Scale(direction,Vector3(0.2,0.2,0.2));
MicroLabel_.endPoint=scaledDirection+MicroLabel*.startPoint;*_
_*```*_
_*<p>In general, scaling is used on direction vectors rather than vectors which represent points.</p>*_
<em>_<p>I'm afraid that I don't have complete answer for how to scale a line's length to keep it in the view port. There was a case where I needed to scale the width of a LineRenderer based on the camera's distance from it.  In that case, I obtained the distance of the camera from the target, then derived a scale based on that distance.  E.g. scaleToApply = distanceToTarget * constantScalingFactor.  Rudimentary, but it worked in my case.</p>_</em>