how do i distinguish between objects..

Get help using Construct 2

Post » Fri Oct 28, 2011 11:36 am

Hey, first of all I'll state that I am new here, I have been playing around, reading on these forums and read the tuts on this site, and god bless C2 is amazing for that new task I got, thanks for that :)

My Question, or my misunderstanding goes like this;

(for short) How do I distinguish between 'object clicked' and 'object spawned' when it spawns on top of 'object clicked' ? it then counts as a click on spawned object.. or is it just me there misunderstood something?

(for long) I have created a sprite, which functions as a clickable box (no graphics) in for example layer 1, when clicked I trigger an event to create a new object, in layer 2, I make it spawn at Mouse.X and Mouse.Y.
This new object have its own "clickable subevents", but my first click on the clickable box, triggers this new objects events - and I am trying to figure out why.

(for illustration) I have a empty box, when I click i spawn a plane, - the plane begins to fly. When I click on the plane, its opacity decreases. My problem is, when I firstly click on the empty box, it counts as a click on the plane, which then 'starts off' on lower opacity than intended -

Just me? or did I misunderstand something?

/NijalNijal2011-10-28 11:37:14
B
4
G
2
Posts: 6
Reputation: 1,179

Post » Fri Oct 28, 2011 12:30 pm

Apparently you have to pay attention to the order of the events.

I reproduced what you said from what you told, here is the working version:
http://dl.dropbox.com/u/36472942/construct/forumhelp/ClickAndSpawn-working.capx
Here is a workaround if ever you need one :
http://dl.dropbox.com/u/36472942/construct/forumhelp/ClickAndSpawn-workaround.capx

And finaly, here is "the original" as you described and experienced it :
http://dl.dropbox.com/u/36472942/construct/forumhelp/ClickAndSpawn-surprise.capx

So as said before, the order of events allows to obtain what is intended.
Nevertheless I'm wondering @Ashley why/how so the plane's on click event gets triggered when creating a new plane, and especially why no object is picked, despite the object being obviously clicked, since it's triggered (when clicking to create a new plane, all present planes on screen get their opacity turned to 99 automaticly, a fading one as a new one).

Tested on FF 7.0.1
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Fri Oct 28, 2011 1:04 pm

Brilliantly Kyatric - Thanks
B
4
G
2
Posts: 6
Reputation: 1,179


Return to How do I....?

Who is online

Users browsing this forum: Braus, supreme676 and 8 guests