Problem: Wait Your Turn!


Reported By: David Tarnowski

October 13th, 2023

THE PROBLEM

Image A: The Animation Snag

During our latest round of internal testing, we stumbled upon a jarring issue affecting enemy behavior. Specifically, enemies would awkwardly freeze between two different animations when switching states. This not only broke immersion but also led to unpredictable enemy behavior, making the gameplay experience less than ideal. After some investigation, it became clear that the issue was rooted in the timing of our state-switching logic. The enemies were transitioning to new states before their current animations had a chance to complete, leading to the observed glitches (Image A).

THE SOLUTION

Image B: Smooth Moves

To tackle this, we turned to the power of Coroutines in Unity. By implementing coroutines alongside conditionals, we were able to control the order of operations more precisely (Image B). This allowed animations to fully play out before an enemy would transition to a new state. The result? No more awkward freezes or unpredictable behavior.

The use of coroutines also had the added benefit of making our code more organized and easier to read. By breaking down the logic into distinct functions, we've made future troubleshooting and feature additions far more manageable.

As we push forward in our development journey, we're committed to polishing every aspect of the game. This fix not only resolves the immediate issue but also sets a precedent for how we approach similar challenges in the future, ensuring a smoother and more engaging gameplay experience for all.

Stay tuned for more updates as we continue to refine and enhance your gaming experience!

Get Psyche

Leave a comment

Log in with itch.io to leave a comment.