How to fly like noclip, without drifting?

Multiple people have asked this question and I haven’t seen an answer yet.

I want something like SetMoveType MOVETYPE_FLY. Problem with it is when the player releases the movement keys he keeps on drifting in the direction he was going before. I want something that stops immediately. MOVETYPE_NOCLIP does it perfectly except I need the clipping.

I guess maybe the issue is you need to quickly reduce the player’s velocity in the direction he is travelling based on the keys released? But I’m not sure what calculations to make or values to use.

show us our code if you want us to help ^-^

This should do exactly what you want.

Damn, I didn’t try uclip because I read it didn’t work anymore. Seems to work fine. Thanks.