How to spawn an Object on another Sprite with UID?

Get help using Construct 2

Post » Wed Dec 11, 2013 12:30 am

Hi everyone,

I really need your help or a link that may help me to find why it does not work.

I have 3 Buttons (sprites)

When I clic on the Sprite named Target, it creates a BlueButton close to it. When I clic on the BlueButton, it should create a BlueObject on the position of the "Target" that was selected.


Sometimes it works and sometimes it does not work and I don't understand why?????

It seems that I have an issue with UID. I posted my capx if someone can help me, I would really appreciate.

Thank you everyone
https://www.dropbox.com/s/qzb474t9usk6jmh/Buttons.capx


B
26
S
10
G
3
Posts: 72
Reputation: 4,008

Post » Wed Dec 11, 2013 3:22 am

You need to pick the corresponding Target first. You already have the UID in BlueButtonUID. Skip the Selected stuff and add Target->Pick instance with UID Blue_Button.BlueButtonUID to event 3. (I'd suggest changing the name to TargetUID).
ImageImageImage
B
71
S
21
G
231
Posts: 3,688
Reputation: 129,352

Post » Wed Dec 11, 2013 5:31 pm

Thank you Blackhornet, I will try that as soon as I'm back home :)
B
26
S
10
G
3
Posts: 72
Reputation: 4,008

Post » Wed Dec 11, 2013 7:59 pm

Hi

I could not open your file, but you can alway try using multiple origin image points ans set them outside the object. when the current object is clicked it in turn will spawn a new object on a origin point that is outside your current object.

hope this helps a little.
B
23
S
8
Posts: 45
Reputation: 1,867

Post » Wed Dec 11, 2013 11:33 pm

Yeahhhhhh Thank you very much Blackhornet.
It works!!!

here is the capx if some people need to do the same kind of stuff

https://www.dropbox.com/s/swdu3508ypb0yfv/Buttons02.capx
B
26
S
10
G
3
Posts: 72
Reputation: 4,008


Return to How do I....?

Who is online

Users browsing this forum: David181, dop2000, namaewayukidesu and 14 guests