Dynamic Lifebars - does mouse click do picking?

Get help using Construct 2

Post » Wed Jul 01, 2015 10:22 pm

hi,

I'm creating some generic lifebars (for the player and enemies) that show up when hit, then fade out. I'm trying to make it so it works with any player or enemy in the game.

I've created a simulation capx using the mouse but it's not quite working.. does onMouse Click Object not pick only that object? clicking with the mouse seems to select all objects of that type. I could be doing something else wrong..

can anyone take a look? thanks!

https://dl.dropboxusercontent.com/u/362 ... thbar.capx
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

Post » Thu Jul 02, 2015 12:00 am

You need to pick the correct health bar as well, you only pick the sprite that is clicked, but C2 doesn't know what health bar you are referring to so it automatically picks all of them.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Thu Jul 02, 2015 1:45 am

@nimos100 ahh thanks.. it was in the wrong place.. I was picking the correct health-bar by using the UID stored in the Sprite... but I wasn't picking it in the Mouse Click Event.. thanks!
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,865


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests