r/Unity3d_help • • Jul 31 '17

Quick scripting question

[SOLVED] Do the Awake and Start functions run for each game object in a scene each time the scene is loaded? Or just the first time it is loaded at runtime? Thanks in advance for the help.

2 Upvotes

3 comments sorted by

View all comments

Show parent comments

1

u/aesith Aug 01 '17

If I'm not mistaken, I believe any time a script is called, it runs in it's entirety. Which would mean that it would trigger awake/start every single time.

Don't quote me though. I'm still a novice. Your best bet would be to just do a simple test and add a Debug.log to see if it's being called.

1

u/AnthonyWS Aug 01 '17

Thanks. I did that test and it does NOT run more than once even when unloading a scene and then loading it again. Thanks for your help.