Five Days Debugging a State Machine Bug
One of my biggest problems after I added in a lot of new features expanding the core gameplay of Whisker 2 was the player character becoming unable to finish orders.
This was a big issue that I wanted to fix as soon as possible because it prevented the game from flowing at all and allowed me to check up on potential other errors because I couldn't interact with the customers.
I originally thought that the problem had to do with the code so I spent a significant amount of time combing through it to try to find the bug. I did change some of the code such as reducing the mouse click to only function as the control for giving the customers food instead of also allowing for food to be dropped(I had a new key for that now, Q.)
It took further investigation and shifting my focus from the code to the actual implementation itself to realize that the true cause of my problems was I had accidentally linked the script to both the parent object and the child object specifically meant to handle this. The problem came primarily because of me linking it to the parent object as it disabled the colliders.
Nevertheless, I was able to fix it and learned the important lesson that bugs don't always come from code when it comes to game development.
