I am trying to find the distance between 2 objects. One is 20 units wide, and the other is only 1 unit wide.
Here is a picture
I already have a script that calculates the “distance” between the 2 blocks, but it shows the distance from the middle of the first block to the 2nd. I only want the distance of the empty space between them.
Here’s the distance script of what I have so far
#pragma strict
var f1 : GameObject;
var f2 : GameObject;
function Start () {
var distance : float = Vector3.Distance (f1.transform.position, f2.transform.position);
Debug.Log(distance);
}
function Update () {
}
So what can I do about this?
Also if you have any questions PLEASE ask.
Thank you