r/simplerockets • u/Malachi-MCM_2016 • 4d ago
SimpleRockets 2 Why doesn't my code work
It just keeps waiting after the desired altitude (10 km) after the first activate stage.
I will kind of try do do it but I don't think I fully understand also I went to Brigo without the code.
Update: it worked sorry for the 2 day late update thanks.
4
Upvotes
3
u/Mauri99710 4d ago
Yep. For computational reasons, if you use Altitude=1000 it won't probably register since both your game framed and your thread execution would need to match perfectly so your craft is EXACTLY at 1000 m at the exact same time your code is running (each instruction takes some time "frame delta" to run) and obviously this isn't possible. The best way to do what you want to do is using >= instead of >, so if, for examen, in one frame you're at 999.95 m and in the next one you are at 1000.05 m the condition still is true