So I have been following a tutorial on youtube on how to make a rogue like game, unfortunately the person making these tutorials has stopped making any more for the time being. Currently my game spawns in goblins who hunt the player. The issue arises when a new enemy gets added and it seems that the animation for the previous enemies already in the game get replaced.
The code has a for each loop so I thought it would loop through all the enemies separately and run their animations, but it seems to be getting overridden somehow.
Code snippet below: