Problem with the Inventory PopUp


Author: Ethan Ortega

Problem: Initially the popup would display when the player interacted with a collectible but I was reworking it to also display with all inventory items. Through this, the problem arose of the text that was being displayed being overridden when you collected multiple items at once. This was due to the items not being cued to be displayed. Originally the animation wouldn't wait to be finished before starting the next one.


Solution: I decided to rework how I was displaying the text by first making a queue. When the function was being called, the item that was being interacted with was inserted into the queue. When there was more than one thing in the queue, it would check if there was an animation already playing. It would constantly check if there were things in the queue and if so it would check if there was an animation occurring to display the text. If there's not, it can play and display the animation for the item at the front of the queue. If there is something in the queue and an animation is playing, that item would wait for the animation to be finished before it got displayed.

Leave a comment

Log in with itch.io to leave a comment.