Please ignore most of the ugliness in this code, what I'm trying to figure out is why the PlanetDeath.emit() function is running before the HTTPRequest is able to fire. When the signal is emitted, it restarts the tree resetting the state. My current guess is that it's resetting the tree so fast that the HTTPRequest is not able to actually get sent completely. I've tried adding a bunch of awaits to my code to try and make it wait for the response but can't seem to figure out what I'm doing wrong.
If I remove this signal.emit() and let it take a couple of frames, it does end up sending the signal and I can see it being received on the server side. Is there something I'm missing here with awaits?