hi,

i am trying to make my entity scan a step and move over it. see the image:



i trace once(trace1) from (min_x,min_y,min_z) to (min_x+10, min_y, min_z)

2nd trace(trace2) is from (min_x,min_y, min_z) to (min_x+10, min_y, min_z+100)

the entity will go up (my.z = my.z+100) if trace 1 > 0 and trace2 = 0;

but my traces giving me values of zero for all.

here my code:
Code:
action entity_walk()
{
	var walk_percentage;
	var move_result;
	var pan_count = 0;
	
	var speed_down = 0;
	VECTOR vFeet;
	vec_for_min(vFeet,me);
	
	wait(1);
	while(1)
	{
		pan_count = 0;



	
	c_move (my, vector(7 * time_step, 0, 0), nullvector, GLIDE);

	trace1 = c_trace(vector(my.min_x,my.min_y,my.min_z), vector(my.min_x+10,my.min_y,my.min_z), IGNORE_SPRITES);
	trace2 = c_trace(vector(my.min_x,my.min_y,my.min_z), vector(my.min_x+10,my.min_y,my.min_z+100), IGNORE_SPRITES);
	
	if(trace1 > 0 && trace2 = 0)
		my.z += 100;
	


	

		
		//walk animation sequence
		ent_animate(me,"walk",walk_percentage, ANM_CYCLE);
			
		
	
		walk_percentage += 4 * time_step;
		wait(1);
	}
}



my above test case involves an empty room. few cubes placed around on the floor.


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook