Hello people. I'm pretty new to C#, so I don't know much about it, but I was testing around and looking at forums on how to stop velocity. I figured it out.
rigidBody.velocity = Vector2.zero;
So this works fine. Ok let me explain this code. The function "Thrust" is used to move the ship forward. The function "UpThrusting" is used to move the ship up and down. This all works perfect without the code line above, but when I add the line to stop the ship, the ship movement breaks. The ship does move straight or up. It only moves if you're holding them down at the same time...
Here is the full code. Any help would be nice, thank you!
↧