BlackYama's Forum Posts

  • 4 posts
  • Isn't that what I did, but I did it in a function? Anyway good you got a solution.

    Hi Codah,

    Yea, both are right and also mine, was not a problem with my code but the fact that I had two families, first with both gate and hero inside and a second with hero alone. This seemed to be enough to break the event but still not sure how.

    Thanks everyone for helping.

  • Hi beni92,

    That works great, I was planning on putting it into a function call as well.

    Thanks.

  • Thx for the replies all.

    The code I was trying to get to work can be seen in attachments. The gist of what i'm trying to do is that every so often the enemy sprites will check to see who has the highest agro and update their tarX,Y variables. I cannot seem to get the event to return ether a hero or gate so that the enemy can update its variables.

    This is not what I think my final code will be, instead of tarX,Y it will be tarUID but have not tried this until I get this running.

    Thank you.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I have 3 sprites, one and two are in a family with 1 variable "aggro"

    Third sprite is in no family with variables tarX, tarY

    The script runs:

    for each "third sprite" > check for family member instance with the highest agro third sprite > set tarX to family.X

    My issue is no matter the aggro var I set to sprites it always returns instances of the first sprite, never seems to check the second sprite.

    Sorry for only text as i'm out and about, I will post an image in a few hours.

    Thanks.

  • 4 posts