Mouse is over object....

0 favourites
  • 4 posts
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • I'm trying to get a line of text to display text when the mouse is over certain objects. The event is fairly simple, just 'Cursor is over object', 'Set text... '. It works, but if I then put an identical event below the first one, only one event responds (the lower line). Any ideas why?

  • Because events sheets are executed from top to bottom every tick (as explained in how events work).

    So the first event is executed, the text is changed.

    And then the second event is executed so the text is changed again.

    So you are under the impression only one of the two events happens, which is false.

  • But if the mouse is only over the top of one of the objects, then surely only that event would fire? What's happening is, if the mouse is over the top of the object in the first event, it never fires at all.

    I understand that if the mouse is over both objects, it will simply fire on each event and the 2nd event will be the one that was executed last.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's because I was using a third 'else' event, to clear the text. The idea being, if event 1 or 2 fire, then it displays the object name, else is clears the text. But I guess I wasn't using else correctly as I was just using it as a seperate event at the bottom.

    Solved it by just clearing it at the top on every tick.

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