Hi im trying to let me units follow the terrain.
It work's right now but it works ugly frown

They are sort of jumping arround when they follow the terrain up or down >.<

How to fix this ?

Here is my code of it:

Code:
	while(me!=NULL) 
	{
		//trace floor
		vec_set(trace_from,my.x);
		vec_set(trace_to,my.x);
		trace_to.z -= 500;
		ground_dist = c_trace(trace_from,trace_to,ignore_me|ignore_passents|ignore_passable|ignore_sprites|use_box);
		
		if(ground_dist != 0)
		{
			my.z -= ground_dist;
	   }
 



-The Dragon's Eye is alway's watching you!-