Just in case no one is bothered to read all this,
TLDR; AI behaving weird and constantly moves towards center, but only after being loaded from a save
So basically I made a save system for my game that stores a dictionary called "savedata" in a file
I made a way to load the game while in that scene, on a death screen, or in the main menu
It loads in "savedata" and then sets the player's variables, after deleting all of the enemies in the default scene and then replacing them with the saved ones.
But once you load the game, all the enemies start drifting towards the center of the scene and all cluster together, probably for some reason to do with physics and the AI that I don't understand
Why does this happen?
Relevant Code for the enemy (deleted irrelevant parts that I'm sure have nothing to do with the issue):
[code removed as I solved this issue myself, I can't delete this post, and I don't want people to see the code for the game if the issue is already fixed :)]
I think this would be all the code relevant to the issue, most of the timers are set to 0.01 seconds because some problems were caused earlier because it needed to wait for another scene to set some values
PlayerStats is an AutoLoad scene that contains all the variables that need to be shared
I spent a long time trying to fix this issue, so I would really appreciate it if someone could point me in the right direction!