Create Object at Other Object's Position (UID Question)

Get help using Construct 2

Post » Sun Jul 03, 2016 9:48 pm

Hello,

I'm making some sort of firework simulator. I have a sprite called "Mortar" that is set on a timer. When the timer expires, I want to create a "Flash" sprite at it's exact location, plus some other things.

The problem is that there could be multiple Mortars running at any point, so the program won't know which one to create the Flash at.

I've looked into UIDs a little bit. How would I figure out an object's UID, then assign it's position to that specific ID?
B
9
S
2
Posts: 28
Reputation: 811

Post » Sun Jul 03, 2016 10:42 pm

If you use the Timer behaviour on your Mortar, it will already be picked (may need a foreach if multiples timeout at the same time).
ImageImageImage
B
71
S
22
G
240
Posts: 3,734
Reputation: 133,994

Post » Mon Jul 04, 2016 2:58 am

Yeah but how do I create an object (Flash, for example) at that specific Mortar's position? There are multiple mortars on the screen at once. That's why I want to know how to pick UIDs.
B
9
S
2
Posts: 28
Reputation: 811

Post » Mon Jul 04, 2016 3:41 am

I wouldnt use UID but rather pick the mortar based on a variable check such as this Mortar with a variable one.

and then do compare variable mortar with variable = 1 ? would that do you better cause every time you add n delete object i was noticing that the uid order got changed around.
B
52
S
24
G
6
Posts: 391
Reputation: 7,845

Post » Mon Jul 04, 2016 5:11 am

As I said, you don't need to pick it. You start the timer on that mortar, then when the timer expires, that mortar is already picked, so just spawn your Flash at it's coordinates.
http://www.blackhornettechnologies.com/ ... imers.capx
ImageImageImage
B
71
S
22
G
240
Posts: 3,734
Reputation: 133,994

Post » Mon Jul 04, 2016 4:03 pm

Oh dur! I feel stupid now. For some reason, I totally forgot about the Spawn Object action. I have no idea why. Lol. Thank you!
B
9
S
2
Posts: 28
Reputation: 811


Return to How do I....?

Who is online

Users browsing this forum: kalibark2 and 25 guests