Object confused when another is destroyed

0 favourites
  • 2 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • I will post pictures if needed but basically I have 2 main objects and a 3rd object that determines when one object is within range of another (overlapping).

    • Soldier object has an invisible circle object around him called Range.
    • When the Enemy object is overlapping Range the Soldier targets the Enemy.
    • When the Enemy is not overlapping (either the enemy runs or is destroyed), the Soldier is SUPPOSED to continue doing his task.
    • Everytime the Enemy dies his respawn time increases (this is how I found the issue)

    What actually happens is that the Soldier behaves normally when the Enemy is alive, both when Enemy is overlapping and not overlapping the Range. However when the Enemy is destroyed while overlapping Range the Solider continues to target where the Enemy was UNTIL the Enemy respawns, which then he acts normally again.

    So during the time that the Enemy object is destroyed the Soldier still thinks the object is alive in that previous spot. I DO destroyed the Enemy sprite. I also have tried working around On Enemy destroyed by using variables and whatnot, but it seems like there's something in the Construct 2 logic that I do not understand.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You should condition NORMAL behavior on some other flag, then change that flag on overlapping or not.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)