Hi, my problem is, that my unit falls a bit into the ground after he successfully jumps. I raise the jump_percentage with +3*time_step but the unit falls more than it raises. I started the debugger and it shows me that jump_percentage is nearly -0.045, not always the same number, but nearly the same, so it changes after every jump. I though it would be 0 after every jump but it isn't. Is it because *time_step? If so how can i fix it?

Here is my code:

Code:
action guard_with_pointer() // Movementsystem
{
	guard1 = my;
	while (1)
	{	
		ent_animate(my, NULL, 0, 0); // Animation reset
		if (key_space && guard_life > 0) // Player jumps
		{
			jump_percentage = 0;
			while(jump_percentage < 18) // Raise into air
			{
				c_move (my, vector(0, 0, jump_percentage *time_step), nullvector, GLIDE); // Raise for jump_percentage
				ent_animate(my, "jump", jump_percentage, NULL);
				jump_percentage += 3* time_step; // Increase jump_percentage
				wait(1);
			}
			jump_percentage = 18;
			while(jump_percentage > 0) // Fall from the air
			{
				c_move (my, vector(0, 0, -(jump_percentage *time_step)), nullvector, GLIDE); // Fall for jump_percentage
				ent_animate(my, "jump", jump_percentage, NULL); 
				jump_percentage -= 3* time_step; // Degrease jump_percentage
				wait(1);
			}
		}
		wait (1); 
	}
}


Screenshot:




1338, beyond leet.