problems with pinning.

Get help using Construct 2

Post » Thu Dec 17, 2015 12:33 am

Still kind of a beginner here, so forgive the noob question. I am having problems pinning objects in a platform game I am working on. I have several enemy copies running around, and I want each of them to have a bazooka pinned to the, but ounce my player gets close to the first enemy, all of the bazookas move with the first enemy, leaving them floating in the air. They are also destroyed when the first is destroyed as well. If anyone can tell me how to pin them to each individual enemy, that would really help out. I know it has to do with uids, but have no real clue what to do from there.
B
12
S
3
Posts: 30
Reputation: 842

Post » Thu Dec 17, 2015 1:06 am

I don't use this method too often but I have a lazy way of doing this, I don't know if it's necessarily the 'right' method, but I use 'FOR' :

system(for) "name" from enemy.IID to enemy.IID > pin bazooka to enemy.

This matches up the IDs, so first instance of bazooka would pin to first instance of enemy, second instance of bazooka pins to second enemy etc
Also note that this will still mean that they are floating in the air from their current position, you'll have to also add : set bazooka position to enemy.x,enemy.y, to teleport them to the enemy position (unless they were created at enemy position of course).
B
46
S
16
G
74
Posts: 2,088
Reputation: 44,185

Post » Thu Dec 17, 2015 4:19 am

Not really sure what it is I'm suppose to do, but I have been adding a new event, click for (which is under loops?) then it gives me three lines to fill (name, start index, end index). Is that right? I think I might have missed something.
B
12
S
3
Posts: 30
Reputation: 842

Post » Thu Dec 17, 2015 1:04 pm

Yeah that's the one.
B
46
S
16
G
74
Posts: 2,088
Reputation: 44,185


Return to How do I....?

Who is online

Users browsing this forum: facecrime, mihirolover, Yahoo [Bot] and 6 guests