Is it possible to specifically adjust the order in which a game object’s Update() function is called?
Nope. You can never rely on any specific order. Ever. Nor can you adjust the order. Sorry
You can use a manager script to call an update-like function on each gameobject each frame.
Thanks guys. I wanted most of my objects to manage themselves, but since that is not possible, I will write a manager class.
I tested Update order of game Objects in Unity 4.1.2
All objects updating:
- From Deeper child, to Upper parent.
- From Bottom (alphabetically) to Top.
i.e. inversed Parent to Child updating, and Children updated with inversed Alphabetical order.
i.e. seems i can rely on specific Hierarchy Depth order, with assuming Children order is random (because alphabetical order is not often useful anyway, but still can be useful).
UPD: Nope, after unity’s restart update order is broken to completely random. This is rly lol. Unity you make me laugh, more i learn you, more i think that u sux.
note: this thread is more than 4 years old. in the meantime UT has added script execution order. can i assume that makes unity suck less for you?
Who knows who knows. I was needed Object execution order by Depth, but may be Script execution order may be some kind useful for me. Or i will just try to use my own “MyUpdate()” function.
For example i have Zones, and i need to Update each object inside Zone separately from each zone. With script execution order i have to create individual Script order for each Zone clone? i dont think so.
As far as i understand Script execution order was made for “Global Layering”. I need “Local Zoning”, i.e. Parent to Child updating.
Parent to Child ordering could be implemented on top of Script execution ordering, as more abstract order. But Unity developers too lazy. They better just Update hashtable with all game objects, which is totally useless.
The thing is, that i am trying to understand now, how i am gonna to Structure my Game Client.
Ofcourse i am gonna use built-it Unity’s Hierarchy (Object parenting). So i was expected that, if i create Child tree, this tree will be Updated as Single Object with all children. This behaviour is obvious for every normal human. But the fact is - Unity updating every object, even children, out of any order. Thus every object in Unity’s hierarchy updating as if it doesnt have hierarchy at all, just global list of unordered objects.
Ok, fine, let the objects be updated All At Once, not so critical for Client. Usually i need specific update order for Server Zones, or Server Game Instances, which client doesnt have anyway. So lets forget about Object execution order for now, we can live without it inside single Client (perhaps).
i guess you are using unity free? so you complain about a product you got for free?
have you checked if there is already a feature request for your required feature? if there is one vote for it, if not create one. UT cannot know what users want when they don’t tell them.
also i find it very disgusting to complain about the unity devs that they don’t have implemented a feature you require before you need it. (and tell them). simply switch to an engine which has that feature and save you and UT the hassle.
you are right. it’s so useless that noone uses an update function. i wonder why they don’t remove it to save the resources. static games where nothing happens are much more interesting than those available today where player must react to or even control the game.
seriously. unity is a tool which offers many stuff game deveopers need. if it has not what you need develop your own system or go away. complaining about it in a very inclement manner helps noone. there are many people very happy with unity (including me) and if you are not chances are it’s NOT UT’s fault.
EDIT: and this behavior of you will hopefully prevent people in the forum from helping you. its a pitty that the forum has no blocklist.
You funny and totally useless.
and you are quite arrogant and your usefullness has still to be proven.
True.
I also can say: The more i understand Unity, the more i like it.
But sometimes it really annoys me.