How do I effect one character at a time

Get help using Construct 2

Post » Mon Aug 24, 2015 5:10 pm

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
B
6
S
1
Posts: 46
Reputation: 476

Post » Mon Aug 24, 2015 6:14 pm

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.
B
90
S
44
G
17
Posts: 1,012
Reputation: 18,527

Post » Mon Aug 24, 2015 8:03 pm

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.
B
8
S
4
Posts: 131
Reputation: 1,205

Post » Tue Aug 25, 2015 4:44 pm

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
B
6
S
1
Posts: 46
Reputation: 476


Return to How do I....?

Who is online

Users browsing this forum: R0J0hound and 3 guests