Hi all,

Super-Noob here... shocked

I'm trying to animate a switch moving into the top position. I've got a frame called "top" on the Model in MED (only 1 frame - top1).

My code keeps returning a 1515 error. It has to do with my animation line. How do I fix this?

Code:
ENTITY* t_trigger;

function turn_on()
{
	var trig_percentage =0;
	
	while(1)
	{
		trig_percentage %= 100;
		trig_percentage += 2*time_step;
		ent_animate(me, "top", trig_percentage, ANM_SKIP);
		wait(1);
	}
}

action trigger_switch()
{
	t_trigger=me; //this is a pointer defining the entity listed at the top
	on_enter = turn_on;
}