I have 2 objects. It will be in various direction amd distance.
How can i instantiate objects between them with a specific distance.
I have 2 objects. It will be in various direction amd distance.
How can i instantiate objects between them with a specific distance.
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:
http://answers.unity3d.com/questions/478199/finding-the-direction-an-object-is-moving-and-givi.html