Dear Kru,

Thanks very much for your ultra fast reply!

As I mentioned, simple numbers works flawlessly, they are totally follow the described behavior.

I only experience difficulties, when I try it with coordinates including negative numbers.

I’m also looking for a distance from one end of the AB vector and not a proportion/percentage so using Lerp with normalized vector gave the exact same results for coords with negative numbers.

I think I need to create absolute values somehow, to correct the anomaly of negative coords, but I’m just not good enough in Math to find a solution so far.

UPDATE: OK, I have just created a script that places the objects according to the formula, and it works totally fine, no matter if the numbers are negative or positive. I don’t know what I made wrong earlier, but now it looks all fine.

Sorry, it must have been my bad, I just messed up something.

Here’s my script just in case if anyone would try it:

// create an empty gameobject, then create 2 spheres and a cube under it

// attach this script to the empty gameobject and assign the 3 objects to public vars

// I placed the gameobject at 0,0,0 and the camera at 0,0,-30

using UnityEngine;

using System.Collections;

public class test:MonoBehaviour{

public GameObjects1;

public GameObjects2;

public GameObjectcube;

Vector3 a = new Vector3(4,-9,16);

Vector3 b = new Vector3(-4,8,-12);

Vector3 c;

void Start() {

s1.transform.localPosition=a;

s2.transform.localPosition=b;

c=a+((b-a).normalized*30);

cube.transform.localPosition=c;

}

}