so when they spawn they go right to the player. this is stored in UPDATE.
BUT. when the player dies, an error pops up
“NullReferenceException - Object reference not set too an object”
and i understand why, its because the player is no longer on screen. but have tried doing this to Awake() also Start(), which does work to some degree, it does take away the error message.
but, it only updates on the last position, so the enemy stays where the player was last. if i move the player, the enemy will not follow. only the newest spawned enemy will, until i then move the player again.
how can this be fixed?