Detect the ID of the sprite being overlapped?

Get help using Construct 2

Post » Mon Dec 23, 2013 12:35 am

Hi :)

I can't see an obvious way to detect the ID of a Sprite object that is being overlapped by another. I was wondering if anyone knows how to do this/if I'm missing something? Thanks!

Through this I am hoping to create a 'Marker' system.
I currently have a level with many platform sprites at different heights, i want a marker sprite to spawn over the platform at the point where a user clicks. By knowing the ID of this platform I'll be able to access it's co-ordinates (specifically it's Y co-ordinate) and therefore, combined with the X co-ordinate of the users click location, spawn said marker.

Just thought I'd clarify my intentions in case someone can think of a better way of doing this!
B
4
Posts: 1
Reputation: 229

Post » Mon Dec 23, 2013 1:57 am

Your descriptions don't really match each other. This sample picks the object you click on, and spawns a new sprite at the X coordinate of the mouse, but the Y coordinate of the clicked object.
clicksample.capx

Hopefully something in here helps.
ImageImageImage
B
71
S
22
G
249
Posts: 3,763
Reputation: 138,577

Post » Mon Dec 23, 2013 10:37 am

You can use a local global variable named pickedUID. Then, condition: on marker collision with platform, action: pickedUID=platform.UID If I get you right.
B
18
S
4
G
1
Posts: 332
Reputation: 3,149


Return to How do I....?

Who is online

Users browsing this forum: Kyatric and 33 guests