So, in my game I have enemies that the player must fight.
Original, I know.
I made a class, and in that class, will be different functions for different enemy movement patterns, as well as some universal things in init that can be set when it’s instanced. (max HP, ext…)
Right now there’s only one movement pattern; go to the player and shoot regularly.
Now, part of the code outside the class - in the function the enemy is running - makes it so that the class is only instanced when the player gets to a certain point - AKA the enemy “wakes up”
(the game automatically scrolls, so the enemies will be “encountered” in the same order every time.)
I started running into issues when I made multiple enemies in the level - but here’s the catch - the order the enemies appear in affects which one messes up in what way, and not consistently either - while the 4th or 3rd or whatever enemy always has the same problem, every time you add another enemy, who knows what it’s do? it’s not like “4-5 do X, and every odd numbed one past 7 does Y…”
All I can think is that somehow each enemy is affecting the one that comes next, like the HP value being transferred or whatever, but, if one object is running a script, and another is running the same script, they should be totally independent of one another, right?
I don’t need to know exactly-what-line-of-code-is-messing-this-up, just why this may be happening, so I can fix it now and forever-more, but if you do need the .blend, just say so, and I’ll attach it to a PM or something.