How do I highlight one particular instance of an object?

Get help using Construct 2

Post » Sun Jul 23, 2017 3:00 am

I feel like this should be really simple, but it doesn't really seem to be... at least not to my dumb noob self :/.

I've got a pretty simple 2D platformer, in which the ground tiles are destructible so that the player can carve his way through the world (similar to Oxygen Not Included but waaaaaay simpler). The issue I'm having is that whenever I try to use the "Cursor is Over Object" condition to change the tile to the "highlighted" animation, it highlights all tiles of the same type that the cursor moves over, until it moves over a different tile type.

My event sheet is roughly:

Cursor Is Over "tile_land" > set "tile_land" animation to "highlighted"

Negated Cursor Is Over "tile_land" > set "tile_land"animation to "Default"

However, when there are two land tiles right next to each other, and you move the cursor over both, it highlights both tiles, and only unhighlights those tiles when you move the cursor over empty space. I've tried using the "Trigger Once" condition, but all that does is highlight only the first tile and no like tiles the cursor moves over afterwards.

Basically, I want the cursor to highlight one and only one tile at a time, and that's the tile that it is currently hovering over, but I can't seem to figure how. I tried screwing around with instance variables and UIDs, and I think I just gave myself acute dyslexia, so any help is very much appreciated.
B
7
S
2
Posts: 4
Reputation: 483

Post » Sun Jul 23, 2017 3:06 am

Adding a 'for each tile' at the top of the event should stop this from happening.
B
47
S
17
G
81
Posts: 2,225
Reputation: 48,097

Post » Sun Jul 23, 2017 6:35 am

plinkie - That did the trick! Thank you :)
B
7
S
2
Posts: 4
Reputation: 483


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests