Hey all.
I've been rebuilding a game I made for the Ludum Dare challenge a few weeks back. I've been optimizing, and as such have begun using Families for my Enemies. So I don't need to make the same blocks in the Event Sheet for each enemy type as I was before.
I got their movement to work just fine, but setting up proper collision to turn each one around, when it collides with an object setup on every platform at the start of the layout.
I'm moving onto the combat system, and I'm having some trouble changing the Enemies' State over to "Attack", which should play an animation with the same exact name. I'm not sure what I'm doing wrong. So before I get to far, I figured I would come here and ask for help.
I do apologize if this has already been answered, I've been searching the forums here, and Google for a while. I also read the documentation on the Families Object. Also, checked out the Families example in Construct. Not sure what I am doing wrong in this case.
As you can see in the "Enemy Setup", I am creating some debug text above each enemy to see if the State changes over to Attack. And, so far no good. Under the "Platform Enemy Attacks > Melee Attack" Group, you can see my attempt at switching the enemies state to Attack, when it is in line of sight. While also making sure it faces the Player by checking the PlayerBox's X coordinate.
So far the mirroring of each enemy is working properly, based on if it is within LoS of the player or not. But, it never changes over to the "Attack" state. As you can see I tried it in the sub events. Then tested setting it to Attack right next to the condition for "Has LineOfSight". Then setup a whole new conditional block, to check if in Attack State to set the animation manually.
EDIT: I meant to mention, that it seems like the enemy gets ready to attack. It shows the first frame of their Attack Animation, and mirror appropriately to face the Player, but do not stop and play the animation. They were doing just that, when I had them each setup individually, and not within a Family Object.
The screenshot of my Event Sheet is large, so I've linked to it here: https://i.ibb.co/dDWLwxk/screencapture-editor-construct-net-r292-2022-04-27-22-26-44.png
If anyone notices what I'm doing wrong here, and has some time to lend some help. I'd greatly appreciate it :) I have a feeling I need to do a similar "For Each" Condition, like I did for creating the debug text object "txt_EnemiesState" over each enemy in the family. I'm assuming I would need a similar check to see which Enemy to change to the Attack State? I remember reading or watching something a while back. Something about generating UIDs using a For Each on a Family, then taking proper action based on the UID. Not sure if that's required in this instance. I'm a complete newb when it comes to the Family Structure within Construct.
Or maybe it is something entirely different, staring me right in the face.
I hope everyone is having a fantastic day/night!
Thanks in advance! Take care :)