Jetpack

Hello everyone 
You have a serious problem. The code as it is right now will hang Unity. The issue is the while loop on line 26 combined with you declaring gas an integer. So your while loop cycles, increment gas by some small fraction. Bug since gas is an integer, it never increased (stays zero), so the while loop never terminates. And you don't want a while loop anyway. There are a few more problematic things here as well. For example, you are using CharacterController. Move and CharacterController SimpleMove. You should pick one or the other.Here is the results of some quick hacking on your code. It could be written better, but it gives you a starting point. If you jump, you will go to the top of the jump height and stay there (flying) until you run out of gas.

Comments