Hey,
Thanks for all the work you put into this! You didn't have to, I wasn't really bothered about it (again, all of this is just a test for now), unless you'll tell me that that was the reason for the animation fault! :)
I was using the Line of Sight to detect the player first, but the thing I found out I was doing wrong was that I made it very complicated for the "AI" to attack by setting all these conditions, except the correct ones, so the "AI" was trying to do multiple things at the same time. Also, I think your way of detecting the range is way simpler and more efficient.
A couple of points, however: your method is indeed simple and efficient, however, I don't see it being useful in the long run. At present, whenever the skeleton attacks, it just basically loops and also is still moving towards the player. By having a boolean called "following" I could control the movement states of the skeleton and stop it from moving when attacking. I also had the states created for the skeleton to deal with that. Do you have a better idea instead?
My idea was to create a function (or a group) that would handle the attack routine by itself, and then call the function or enable the group when the skeleton is inside the melee range (your Reach variable works just as well). I was having the issue with the animation, because the conditions set for it to play were very confusing.
Ultimately, I want the skeleton to be able to follow the player a certain range, to attack the player when inside a certain range, and when attacking, to be able to set other conditions as well (to deflect incoming attack, for example).
Are there any tips or insights you may want to share as well? I have looked at tutorials, but for some reason, tutorials that cover melee combat are not that many, and usually are pretty basic.
Thanks again for all the help so far!