void Update()
{
MoveToOffice = Vent.GetComponent<VentButton>().VentClosed;
if (BrandonPos == 10)
{
Join();
}
else
{
Debug.Log("PosTen is running but BrandonPos does not equal ten.");
}
}
IEnumerator Join()
{
rend.enabled = true;
MoveTrue = false;
Debug.Log("PosTen Activated");
yield return new WaitForSeconds(4);
rend.enabled = false;
BrandonPos = 9;
yield return new WaitForSeconds(4);
BrandonPos = 6;
yield return new WaitForSeconds(4);
FindRandomValue();
if (RandomValue == 1)
{
BrandonPos = 4;
}
else
{
BrandonPos = 7;
}
MoveTrue = true;
Move();
}
There are no errors in the editor, but when BrandonPos is 10, I don’t get the ‘PosTen Activated’ message from Debug.Log, and BrandonPos does not change. Why is this happening?