Hey, sorry for leaving you high and dry there I had some unexpected work come up.
I have redone your ranged enemy event sheet to show you how to set up the events for what you wanted.
**Please do not save over your existing work with as I've deleted some other things just to make it easier for me. You will need to create the instance variables I have created and then copy the event sheet across.
The majority of your problems were just incorrect picking events and the use of "for Each" in the wrong spots meaning that it would wait for one instance to complete a bunch of stuff before it would move onto the next one.
See the notes in the project file for more info on what I have done :)
No problem, the bump was just a general bump not trying to push you to post earlier. Sorry if it sounded that way. Thank you VERY much for fixing the issues in the project.
If you don't mind I have a few questions, since I thought I understood how these things worked better than this.
- Let's start with the simple one; wouldn't 3 For Each loops be an issue performance wise?
- Same question for picking, we're doing lots of picking in this event now. Won't that be an issue performance wise since it has to pick ALL instances then filter through them? Doing that multiple times isn't an issue? Let's say I have about 100 enemies on the screen at any given one point and about 10 villagers as a worst case scenario (this of course excludes GUI, background elements, objects and VFX).
- Is setting UID to -1 wrong? I am asking because I saw you set it to 999 and I wasn't sure if UID can be set to -1 or not.
- Why did you do the pathfinding this way?
Didn't the part that says "Pick Villager" in the screenshot above already picked the villager? Why not use that then to pathfind directly instead of saving its location for later to pathfind to separately?
I am asking because I am trying to understand the mode of thinking so I can modify my own.