I need to retrieve the UID

Get help using Construct 2

Post » Sat Mar 29, 2014 1:30 pm

How can I select the specific bullet object (with bullet behavior) that my enemy object spawns?

SYSTEM: Pick by comparison: Pick Bullet object where Bullet.UID = what?
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Sat Mar 29, 2014 1:38 pm

Just store the UID when you spawn it. Use an instance variable on the Enemy, if that makes sense. This is only if there is one bullet at a time. Otherwise, you'll have to provide more details on what you are trying to do.

Enemy.StoredBulletUID = Bullet.UID
ImageImageImage
B
71
S
21
G
231
Posts: 3,688
Reputation: 129,352

Post » Sat Mar 29, 2014 1:54 pm

wait, I store the UID of the bullet to the enemy's instance variable? Did I get that correctly?

Well, there are many instances of the same gunman object enemy at the same time, so that's why I need to know the specific bullet shot by each enemy. Is what you said correct for my situation?
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Sat Mar 29, 2014 2:11 pm

In that case, you need the opposite. If you want to know who shot which bullet, you store the Enemies UID on the bullet.
ImageImageImage
B
71
S
21
G
231
Posts: 3,688
Reputation: 129,352


Return to How do I....?

Who is online

Users browsing this forum: DharmaOne and 6 guests