Ok. Are you executing a function with this vec_dist that displaces the character in z? Or are you using it directly, like: my.z = vec_dist.z; ? The later isn't a good solution, because when hitting space the player will automatically be at 5 quants above.

The reason I'm asking is that, to do the double jump, the code got to ask in what point of the jump the player is. If it's in the top of the jump AND pressing space_key then increase z speed. Something like that..

I still don't understand what you're doing.