It does print 6. Something so basic is highly unlikely to be a bug…whenever I find a “bug” I make sure to exhaust all possibilities to determine that it actually is a bug before filing a report, because it’s usually just something I’m doing wrong, and they don’t need any more bogus “bug” reports than they already get…
And I’d follow it if I were working on a game. But for testing purposes, it’s useful to run a few lines of code in an empty script. I’ve never run into a problem doing this until now.
Just put any code in a Start or Awake function…there are a number of problems that result if you don’t; quite lucky if you haven’t run into any before.
Yes, all external statements in JavaScript, aside from variable declarations, get automatically moved to a Main() function. Main() is called immediately before Start().
I think you can still manually declare it if you want, although it’s undocumented.