What should I do to add a static stop to a spaceship controller script I’ve been working on? I am not asking for somebody to make the function. I am just asking what would need to be included and how would I do it. Increase rigidbody drag on button up? Apply a force in the opposite direction? As it is when any movement key is let go of the ship immediately snaps to a stop. I’d like it to slow down and stop not immediately but quickly. I’d like to hear your input, as I am not sure how this should be done.
This sounds like it might be more suited to a forum discussion rather than Unity Answers - there’s no correct “answer”, since you’re not really asking a question. What’s more - knowing the most appropriate way to slow down a vehicle probably requires knowledge of what made it move in the first place
If you’re trying to create a physics simulation, then you need to consider forces of drag, gravity, friction etc. and use these to act upon a rigidbody component. Since you’re talking about spaceships, drag is not really relevant - you’ll need to apply some sort of reverse thrust to counteract any forward motion.
If you’re creating a shoot-em-up and want to add a little bit of “momentum” to the movement of the spaceship so it doesn’t come to an abrupt halt, you could simply decrease the speed in a loop - something like `if(!movementkeyspressed) {spaceshipspeed *= 0.7;}
I’d recommend you simply try different approaches until you get something that “feels” right for your game.