Quantcast
Channel: Answers for "What's the difference between code in Awake() and code at the top of the script?"
Browsing latest articles
Browse All 6 View Live

Answer by Proclyon

There must be a ton of this question and a ton of answers but here you go:Awake is called BEFORE start. Start is a place for your initialization:private int x; private Vector3 left; private bool...

View Article



Answer by Loius

Code outside any function runs after Awake (but before Start).Initializations, however, run before Awake if they're not in a function.So you can have, for example,var x : int = 7; var y : float = 0.5;...

View Article

Answer by duck

Code outside of any function goes into a special separate function in Javascript (which is hidden from you, but incidentally is called "Main"). This function is called before Start, but not before...

View Article
Browsing latest articles
Browse All 6 View Live




Latest Images