Switch between scripts

Ok how about you use a boolean signal instead of while app.simulation.IsRunning == true statement.

Are the two scripts within the same component or is it separate components?