How do I correctly save these UIDs of the specific enemy?

Not favoritedFavorited Favorited 0 favourites
  • 3 posts
From the Asset Store
Match the similar cards with each other and free all animals!
  • I have 4 sprites connected in a hierarchy:

    Enemy, Enemy Hand with Bomb, Enemy Bomb, and Enemy Hit Area.

    When the hero overlaps the Enemy Hit Area:

    - The enemy drops a bomb.

    - The enemy's hand with the bomb gets hidden.

    - Once the bomb is destroyed, the hand appears again.

    Problem:

    I have 3 instance variables in the sprite "Enemy Hit Area" to store the UIDs of:

    - The Enemy

    - The Enemy Hand with Bomb

    - The Enemy Bomb

    How do I correctly save these UIDs so they only reference the specific enemy and its parts associated with the Enemy Hit Area that the hero is currently overlapping?

    Right now, I'm using "Last created", but that causes only the last created enemy to drop the bomb, even if the hero overlaps a different one.

    Error Video: webmshare.com/play/RL1nv

    Events:

  • 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 instance variables in the sprite "Enemy Hit Area" to store the UIDs of:

    With hierarchies you don't need to store their UIDs! Use "pick parent" and "pick children" conditions to pick other objects in the hierarchy. For example:

    Hero on collision with EnemyHitArea
    EnemyHitArea pick parent Enemy
    Enemy pick child Bomb
     : Bomb remove from parent
     : Bomb play animation "Explosion"
    
  • > I have 3 instance variables in the sprite "Enemy Hit Area" to store the UIDs of:

    With hierarchies you don't need to store their UIDs! Use "pick parent" and "pick children" conditions to pick other objects in the hierarchy. For example:

    > Hero on collision with EnemyHitArea
    EnemyHitArea pick parent Enemy
    Enemy pick child Bomb
    : Bomb remove from parent
    : Bomb play animation "Explosion"
    

    Thank you very much

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