Instantiate gameobject between 2 objects

I have 2 objects. It will be in various direction amd distance.

How can i instantiate objects between them with a specific distance.12234-test.png

Assuming ‘object1’ and ‘object2’ are the transforms for the two objects, you can find the position 1/4 of the way from object1 to object2 using:

var position = object1.position + (object2.position - object1.position) * 0.25;

There are a variety of ways to do this calculation based both on fraction and on distance. See this post: