Answer the question
In order to leave comments, you need to log in
Is there any difference where to move the object?
So it became such a seemingly simple question, but still.
There is a control script, everything is calculated in it, especially which object (prefab) should move when and where, is there any difference to do the move in the same script
void Update(){
if(Cells.Count > 0){
foreach(KeyValuePair<string, ObjectCell> kv in Cells){
if(Vector3.Distance(..................) > 0.01f){
kv.Value.transform.position = Vector3.MoveTowards(.......);
}
}
}
Answer the question
In order to leave comments, you need to log in
The difference is that you don't know the order in which updates are called.
Those. in this case, as in your code, the positions will change exactly in the order in which the elements are located in the list.
And if you pass coordinates to them and they themselves will move in updates, then the sequence within the frame is not defined.
This does not mean that it is bad or good - this is a fact that simply needs to be taken into account.
Other than that, it's just a matter of architecture.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question