Hello i am wondering on how to do this
in Pic1 SEG3, for example i know how to do whats in SEG1/SEG2 with this
Vector3 position = controlPoints<em>.position + j *(controlPoints[i + 1].position - controlPoints_.position) / segCount;
(For more about the code visit [here][1] its an old question i asked about dividing between two points), but i want to know how to do this in SEG3(which we’ll come around in second), as you can see in SEG2 when i move it the subPoints will always stay in the center, but i want to know when i move it like in SEG3 that sub points stay specific distance(int distanceCP) away from the controlPoints, would anyone know how to do this??
- -Pic1
[77692-capture65.png|77692]*
_____________________________
Here is the code that does SEG1/SEG2.
public class Points : MonoBehaviour
{
public Transform[] points;
public GameObject GameObj;
public float GameObjectAmount = 2;
void Start()
{
duplicateObject(GameObj, (int) GameObjectAmount);
}
public void duplicateObject(GameObject original, int howmany)
{
howmany++;
for (int i = 0; i < points.Length-1; i++)
{
for (int j = 1; j < howmany; j++)
{
Vector3 position = points_.position + j * (points[i + 1].position - points*.position) / howmany;
Instantiate(original, position, Quaternion.identity);
}
}
}
void OnDrawGizmos()
{
for (int i = 0; i < points.Length - 1; i++)
{_
_Gizmos.DrawLine(points.position, points[i + 1].position);
}
}
}
@b1gry4n @Bunny83*
[1]: http://answers.unity3d.com/questions/1226054/how-do-i-instantiate-gameobjects-in-between-multip.html*_
_