Region between two 3dvectors

Hello everyone. I am doing a rts-like demo just to learn more about Unity. What i am trying to do is getting a region between two vectors

So when i click once. I will get the start position on the map. and when i release the mouse, i want the end position and the start position to have a region between each other
What i have so far!

using UnityEngine;
using System.Collections;

public class TargetRegion : MonoBehaviour 
{
	Vector3 _startposition;
	Vector3 _endposition;
	
	[SerializeField]
	GameObject _region; // Is a rectangle trigger
	
	bool rightclick;
	
	void Start () 
	{
		rightclick = false;
	}
	

	void Update () 
	{
		if(Input.GetButtonDown("Fire1"))
		{
			RaycastHit hitinfo;
			if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hitinfo))
			{
				_startposition = hitinfo.point;
				
			}
			rightclick = true;
			Instantiate(_region);
			_region.transform.position = _startposistion;
		}
		
		if(rightclick == true)
		{
			RaycastHit hitinfo;
			if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hitinfo))
			{
				_endposition = hitinfo.point;
			}				
			
		}
		
		if(Input.GetButtonUp("Fire1"))
		{
			rightclick = false;	
		}
		
	}
}

I am raycasting the first and the last posistion. But what i need help with is making the region between the two. So any tips would be helpful.

If you want to make a region exactly between the two, I suggest you use Vector3.Lerp() to get the midpoint of the two points like so:

Vector3 midpoint = Vector3.Lerp(_startposition, _endposition, 0.5f);

Then, get the difference of the vectors:

Vector3 difference = _endposition - _startposition;

If you are using a sphere region, find the magnitude of the difference and use that for the scale of your region:

float uniformScale = difference.magnitude;
Vector3 scale = new Vector3(uniformScale, uniformScale, uniformScale);

If you’re using a box region, use the absolute values of difference as your scale:

Vector3 scale = new Vector3(Mathf.Abs(difference.x),
                            Mathf.Abs(difference.y),
                            Mathf.Abs(difference.z));

Then, just apply here:

if (rightclick == true)
{
    //...raycast here

    _region.transform.position = midpoint;
    _region.transform.localScale = scale;
}

For this to work though, make sure your models are unit scale.