I'm playing with my old movement script, trying to find and fix bugs.
I've found out, that if I do not limit FPS at 60, then I get strange jumping behavior..
I've even found the line which caused that, here it is:
Code:
var gravity = 6;
var slope_fac = 0.5;


absforce.z = -gravity;
move_var = maxv((1 - time_step * friction), 0);
my.dist_z = (time_step * absforce.z) + (move_var * my.dist_z);
absdist.z = my.dist_z * time_step;

if(my_height < bbox_offset){
	if(my_floornormal.z > slopefac / 4){
		absdist.z = -maxv(my_height, -10 * time_step); // this line 
		absdist.z = clamp(absdist.z, -5, 5);
		if((my_height + absdist.z) > 10){
			absdist.z = -my_height -10; 
		}
	}			
	if(force.z > 0){
		jump_target = jump_height - my_height;
	}
}

If I comment that line, jumping stuff disappears.. but without it I lose smooth movement down on slopes.
Any ideas? May be someone already faced something like this. Originally script is taken from A5 movement template.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung