Hi, I’m trying to move individually objects I made in an array in start function.
Problem is when I’m moving them:
for(int j = 0; j < obiekty.Length; j++)
{
Vector3 poruszanie = obiekty[j].transform.Find ("" + drogaDoKosci).transform.position; //taking bone from mesh to move
poruszanie.y = Mathf.Lerp (poruszanie.y, (value[j] * wysokosc), Time.deltaTime * czas);
obiekty[j].transform.Find ("" + drogaDoKosci).transform.position = poruszanie; //moving bone with function
}
That’s working if all objects in array coordinates are (x,0,z). But if I’m using (x, 0 + (more for each one), z) they Instantiating correctly but bone is starting always from 0 because value is range(0,1).
I’ve tried to catch once an start position:
startPoz = obiekty[j].transform.position;
but I cannot add it correctly to function above.
So my question is how can I add start coordinates to value function individually for each object?