I have my code mostly working and I’ve checked all the ways in which it could be going wrong. I’ve determined that it is one single line of code that is causing me the issue that I’m having.
My debug line is showing that when the game starts that my FirstPersonContoller.cavePlatformMove bool is in fact working and equaling false. The line causing me issues I believe is the - if (movePlatform = true)
I have no idea, but despite it being an if statement and that the platform shouldn’t be moving unless it equals true, it updates ignoring my if statement entirely and the platform animatior plays. When I make my if(movePlatform = false), the platform animatior doesn’t play despite the fact that my Debug is reading that it equals false. When I perform the task to make FirstPersonController.cavePlatformMove = true, the platform continues to not move despite the change.
I hope that my explanation is understandable and that someone can help me understand why this is happening to my code. Thank you for reading through this and I appreciate any help I may receieve.
void Update()
{
movePlatform = FirstPersonController.cavePlatformMove;
if (movePlatform = true)
{
m_Animator.Play("PlatformY2");
// m_Animator.gameObject.GetComponent<Animator>().enabled = true;
}
Debug.Log(("is it true: ") + FirstPersonController.cavePlatformMove);
}
= is and assignment == is a comparison which is what you want.
Wow I feel so dumb now. Thank you haha its working 
Don’t worry, we have all done it. Even those of us who have been doing it for far too long and should know better. Although, there is no need for the comparison. You could just write
if (movePlatform)
Albeit it does make no difference for the compiler the explicit comparison improves readabilty IMO. I always prefer my code as explict as possible. Assumptions gone wrong are a main source of bugs.
One simple way to prevent this issue from happeing is writing the constant first. if(true = moveplatform) and the compiler will complain about. Albeit this will lower readabilty. But if you do this consequently your brain will adapt ;).
Ouch. I consider this the single biggest (of many) design flaws of C (and, by Extension, C#). Being allowed to assign values inside an expressions makes no sense, and was a cheap hack that dates way back to 1977, when Kernighan and Ritchie spent too much time out drinking and then forgot to clear up their language definition. Scores of programmers who should know better still proffer silly excuses why it would actually beneficial to be allowed ro do this (most involve loops and being lazy). Yeah, because breaks in your semantic that allow difficult to find bugs is a feature…
As @WarmedxMints_1 Points out, we’ve all fallen into this trap at least once, and this abomination should have been corrected a long time ago. Truth be told, I think you managed to step into this with one of the few possibilities that still allow you to do this (because you are assigning a bool; historically any assignment was allowed, and if the assigned value was 0 (Zero), it was interpreted as false, true otherwise).
So, congratulations, @chevelle_wohr , you managed to unlock the mad_assignment_skillz achievement! 