Hi,
i am working on an enemy moving script. The enemy comes from a start position and flies to next position. There, it should "roll" a loop around the x axis (step 2) but it doesn`t. After reaching -270° entity flies straight ahead.

The only solution, I found is rotationg the last missing 90° on a fixed position (temporary step 3). That`s not nice laugh

Where is my mistake?

This is how it should be:




Thanks

Ditje

Code:
function start_bee() 
{
	while(1)
	{
		me.tilt = 70;
		me.pan = -45;
		my.STATE = 1;
		if(my.STATE == 1)
		{
			if(me.y <=200) c_move(me, vector(0, 0, 10 * time_step), vector(0, 0, 0), GLIDE); // bis 200 gerade aus
			else my.STATE = 2;
			
		}
		if(my.STATE == 2)
		{
			if(me.roll >= -270) 
			{ 
				me.roll -=1;
				c_move(me, vector(0, 0, 10 * time_step), vector(0, 0, 0), GLIDE); // einen Loop fliegen
			}
			else 
			{
				my.STATE = 3;
			}
		}
		if(my.STATE == 3)
		{
			if(me.roll >= -360) 
			{ 
				me.roll -=1;
				//c_move(me, vector(0, 0, 10 * time_step), vector(0, 0, 0), GLIDE); // einen Loop fliegen
			}
			else 
			{
				my.STATE = 4;
			}
		}
		if(my.STATE == 4)
		{
			if(me.y <= 400) 
			{ 
				c_move(me, vector(0, 0, 10 * time_step), vector(0, 0, 0), GLIDE); // einen Loop fliegen
			}
			else 
			{
				my.STATE = 5;
			}
		}
		if(my.STATE == 5)
		{
			// go to final psoition
		}
		testroll = me.roll;
		
		wait(1);
	}
	
}