0 Favourites

How do I effect one character at a time

  • This problem is a little more complicated than the title suggests.

    I have an enemy that is composed of 3 different objects. The enemy's body, enemy's shield, and enemy's sword. Everytime I destroy one of the enemy's body (health < 0 ) I want the items the enemy was holding to fall to the ground. I achieved this by giving it the bullet behavior, set the gravity high, so it goes straight down, and disable it when it overlaps the ground

    So Far everything is working except when the enemy's body is destroyed, it effects all the instances instead of the the instance that is being destroyed.

    PLEASE HELP IM STUMPED

    THANK YOU

  • An easier way might be to simply spawn a copy of that object at the same place as the old one

    stick a physics behavior on it, and let it drop to the ground and roll around etc.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • How do you connect parts to the body ? Pinning ?

    I'm not sure Construct automatically connects pinned sprites to their mother in an event.

    I usually create a variable (like mother_id) to make every Sprite remember who's his host.

    When the body is destroyed, be sure to catch the right sprites using a condition "sword with father_id == body.UID" BEFORE you destroy the body.

  • They are connected to the body by pinning, when the body is destroyed they automatic know to unpin and the bullet behavior pulls them to the ground. But it effects each enemy and the gravity effects all the shields and swords, but because they are pinned they stay on the enemy's body they just rotate.

    Is this their anyway to freeze the position of an object? (It would be kind of lame that they all fall the same way every time but it would fix my problem)

    Im going to try both of your suggestions thanks

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