0
Fixed

2.0.0a6 While Loop not working

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

Bolt Version:
2
Unity Version:
2019.3.0f1
Platform(s):
Windows
Scripting Backend:
N/A
.NET Version (API Compatibility Level):
.NET 4.x
Bolt 2
+1
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!