Hello all,

I have an entity wich I want to lift with a constant speed. How do I do this? I have the following code already. But it's speed is going up.



Code:
var height = 256.000;

function up() {
	while(height <= 1531) {
		//if(height <= 1531.000) {
			height += 0.002;
		//}
		wait(1);
	}
}

action molen {
	while(my) {
	my.z = height;
		...
		if(key_w == 1) {
			up();
		}
		...
	}
}

So if I pres the key W once, the entity need to move up at a constant speed.

I hope you can help me.

Kind regards.