I use this script and it works. The model walks to the end of the path then gets to the start point again and so on.

I've learned thanks to JCL also how to remove the character at the end of the path. Now the final thing i would like to understand is how to make the model go back at the end of the path the same route instead of running straight to the starting point laugh

thank you for your time laugh

Code:
action moveontrack_01()
{
	var walk_percentage;
	var walking_speed = 0.3;
	VECTOR last_pos[3];

	VECTOR direction[3];
	var distance = 0;
	var dist_to_node;

	var current_node = 1;
	
	set(my,SHADOW|PASSABLE);
	path_set(me, "path_000"); 
	while(1) 
	{
		ent_animate(my, "run", walk_percentage, ANM_CYCLE); // play the "walk" animation
		walk_percentage += 6 * time_step; // "3" controls the animation speed
		path_spline(me, my.x, distance);
		distance += walking_speed ;
		vec_diff(direction, my.x, last_pos);
		vec_to_angle(my.pan, direction);
		vec_set(last_pos, my.x);


		wait(1);

	}
}



Last edited by Realspawn; 09/01/15 10:48.

Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain