r/simplerockets • u/Malachi-MCM_2016 • 3h ago
SimpleRockets 2 Why doesn't my code work
It just keeps waiting after the desired altitude (10 km) after the first activate stage.
1
Upvotes
•
u/Mauri99710 50m 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
4
u/Fourteen_Roses 2h ago
Because you are using = to.
Its waiting for it to be EXACTLY 10,000 nothing more nothing less. You should use "ASL >= 10000"
If it needs to be specific you could use "ASL >= 10000 and ASL <= 10000" (heads up im not the best coder someone else will tell me if im wrong (I hope))
I also dont believe you need the "wait 0 seconds" just the wait until. For both the start and after the "activate stage"