0 Favourites

How do I highlight one particular instance of an object?

  • 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.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Adding a 'for each tile' at the top of the event should stop this from happening.

  • plinkie - That did the trick! Thank you

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)