Sorry, maybe it’s a trivial question but I can’t solve it.

I have two vectors, say Vector2 (10.10) and Vector2 (50.50). I would like to build a rect from one to the other of a certain height where the center of the rectangle is positioned in the middle of a virtual line that joins the two vectors.

I have looked at all the properties of the rect () but it doesn’t seem to be possible. Am I wrong?

rect has 2 ways to create it,

so maybe something like,

```
var centerPoint = (v1+v2)/2f;
var size = new Vector2(Mathf.Abs(v1.x-v2.x), Mathf.Abs(v1.y-v2.y));
var r = new Rect(centerPoint, size)
```

Hi mgear, thanks for your reply.

There is one thing that is not clear to me, I understand var size (the width and height of the rect.) but centerPoint in your example is the center between the two vectors but it should be “The position of the minimum corner of the rect”. In fact the rect is not in the correct position, maybe I misunderstood?

oh i see, you are correct… i misread it as middle position

you could then take smallest x and smallest y from those 2 vectors, to use as minimum corner.