I'm trying to get my character to perform a "dash" where their x velocity increases rapidly and then falls over time. However, I'm also maintaining a constant x velocity so the character appears to be running at all times. The problem is trying to figure out when the dash should be considered finished. It can't be finished when the x velocity is equal to the running speed again, because other forces may be acting on the character.
It feels like all the information I need to figure this out is gone because it's all been calculated into the velocity vector, and the actual forces and where they come from are thrown out.
I've considered the following:
final = run + dash + other forces
But this means I couldn't use Unity's forces because I don't know what they're meant to act on(for example should a force pushing me down while I jump be applied to the jump velocity or the not?).
How can I determine how much force my dash should do and how much it should "undo" with the information given by Unity?