I was working on a TD type of game and I couldn’t get the towers to home on the enemies. To be more specific, I wanted the towers to home on the enemies in range, but despite my game logic making sense, I couldn’t understand why the towers weren’t working, so I added this line here:
Which would tell me which enemies objects count as inside the tower range. This is what I got.
No, I’m not bringing these instances of enemy object sprites back to the spawner; in fact, even the debugger counts them as different instances, yet, some of them retain the tint color despite that.
It’s just that one event; there’s no other line about tinting the enemies.
As I said before, I’ve put the tinting event as a way to debug tower range, as the tower is supposed to shoot when enemies enter in its range, and stop shooting when they’re out of the range, but would only start shooting when all enemies were in range, so to debug, I’ve made the enemies tint themselves when in tower range.
tinting will stay even after the condition is not true anymore, to see which one are still affected by the condition tint them to another color in the preceding event so that all are always put back on a baseline color and only get retinted to the other color as long as they are in range
The tinting seems to be a bug. I created a simple project and the tint is surving the delete. I remember reading somewhere that objects aren’t really deleted, they get reused. IDK if it’s timing but the tint isn’t being reset.
When the fly is close to the monster, I spin the monster and both tint and reduce the height. I delete with a mouse press. Some flies spawn tinted but not flat and the monster doesn’t spin when they appear.