title: How to set a gameobject to an exact length in unity
body: <p>In Unity I have a float that represents a distance </p>
  
  <pre><code>float distance = Vector3.Distance(start.position,end.position);
  </code></pre>
  
  <p>I want to use that float to change the size of an object along its Z axis. I tried: </p>
  
  <pre><code>gameobject.transform.localScale.z = distance;
  </code></pre>
  
  <p>However, this just changes the scale, I need to change the game object to an exact length. Is there a straightforward way to achieve this? </p>