I have a number of scripts assigned to some game objects. One Scene is working as expected but the other Scene I add or make an order change of components, save it. When I switch back to the scene the scripts are in a different order.
Is this supposed to happen or is it a bug (5.3)?
Is there any logic the Unity’s re-order?
This seems to cause some errors in the script when re-ordered.
I was under the assumption there is no set order to the components on a GameObject and you should not rely on that order. If there is any documentation otherwise I’d love to see it!
Are you accessing by index number instead of by Type? Adding two of the same component to a single GameObject makes telling the two components apart really hard for me.
One of the scripts was posted as part of a larger package. Oddly it did seem to be order dependent. I’ll dig deeper.
But what’s the point of providing means of ordering if none of that is actually saved with the project or Unity randomly re-orders them?
I assumed it was just to make things nicer in the Inspector. But yeah, now that you mention it, seems like order is a thing.
Order is definitely a thing. Certain things require it (for example image effects).
One thing to note is that there is a bug (or at least annoying thing) where f you rearrange component order on an object that references a prefab the order will revert back to the prefab order.