Error in C++ and blueprint exposure

I exposed a variable to blueprint. Then out of nowhere i noticed when i played in editor nothing i coded was working I checked everything and it waa fine. Then i noticed when i pressed play the bool changed for no reason. Then i Keep pressing play it’ll change after playing and stoping 4 or more times. I want into my blueprint nothing. Then i pressed play a error finally came and said value set to none for the bool? I said good maybe it found the error… I looked and thought no way no clue my code is correct… Just hit compile save on blueprint now it works fine.