The problem was that I overcomplicated the code, and adapting the enemy AI to interact with items turned out to be difficult. So I had to simplify that part and instead focused more on the environment and immersion.