Help with FSM Code.

I am using a PID and FSM to make presets for my arm. My FSM won’t switch states and I don’t know why.
Here is my code:
enum Presets
{
Low,
High,
HighScored,
LowScored,
Down
};
int ArmError;
int Target;
Presets preset;
task Set()
{
const float kP = 0.04;
const float kI = 0.001;
const float kD = 0.01;
int prevError = ArmError;
int integral = 0;
int deritative = 0;
while(true)
{

	ArmError = Target - -(nMotorEncoder[I2C_1]);/*IME is suppose to be here; */
	integral = integral + ArmError;
	deritative = ArmError - prevError;
	prevError = ArmError;
	int speed = (ArmError * kP) + (integral * kI) + (deritative * kD);
	motor[Lift] = -speed;
}

}
task Arm()
{
startTask(Set);
while(true)
{
preset = Down;
switch(preset)
{
case Down:
Target = 850;
if(SensorValue[limitSwitch] == 0)
{
nMotorEncoder[Lift] = 0;
motor[Lift] = -5;
}
if(vexRT[Btn6U] == 1)
{
writeDebugStreamLine(“Works”, 1);
preset = Low;
}
else if(vexRT[Btn6D] == 1)
{
writeDebugStreamLine(“Works”, 1);
preset = LowScored;
}
writeDebugStreamLine("%d", Target, 1);
break;
case Low:
Target = 40;
if(vexRT[Btn6U] == 1)
{
preset = High;
}
else if(vexRT[Btn6D] == 1)
{
preset = LowScored;
}
break;
case High:
Target = -410;
if(vexRT[Btn6U] == 1)
{
preset = Low;
}
else if(vexRT[Btn6U] == 1)
{
preset = HighScored;
}
break;
case LowScored:
Target = 200;
if(vexRT[Btn6U] == 1)
{
preset = Low;
}
else if(vexRT[Btn6U] == 1)
{
preset = Down;
}
break;
case HighScored:
Target = -240;
if(vexRT[Btn6U] == 1)
{
preset = High;
}
else if(vexRT[Btn6U] == 1)
{
preset = Down;
}
break;
}
}
}

You first statement in your while loop is preset = Down; so your state gets reset to Down whenever the loop ticks over.

Should work fine if you move it above the while (true).

Thanks