2.0.0a6 While Loop not working

Hyper 1 year ago updated by Lazlo Bonin (Lead Developer) 1 year ago 3
Trying to run hanged unity. Note code generation shows up empty.

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):
.NET 4.x
Bolt 2
Fixed (Unreleased)

Hi Hyper,

Thanks for the report.

I fixed the bug where the while body statements were not being emitted in the next version.

However, the fact that Unity hangs is not a bug. You probably have the "test" variable set to true. So your loop never exits, and the frame takes forever. Remember that loops are not executed one-iteration-per-frame by default. To do that, you need to put your loop in a coroutine, and wait for the next frame. For example:

Hmm yeah forgot about that. Important thing to note in the upcoming documentation!