So I have a timer that is supposed to run at the beginning of an enemy state, but sometimes the timeout wouldn’t trigger and the enemy would be stuck in the state. When I print the time_left inside the process function, it shows that timer.start() gets executed but the time left stays at zero and never changes. I run into this issue when the enemy goes into this state from the same state.
Is the timer set as a one-shot? I’m not sure how you are using it, but if it was one-shot, then you wouldn’t need walk_timer.stop() at the end of your walk_timer_timeout() function.
Unrelated,
walk_timer.start(2)
is the same as:
walk_timer.wait_time = 2
walk_timer.start()
Based on what you’re saying, I would guess your enter_state() code is not being run when you transition from the same state.