How do I disable collisions for text objects?

  • I've implemented a custom check-button in my game. The check-button consists of a sprite and a text object.

    If the mouse clicks on either the sprite or the text, the button's state is toggled.

    Sometimes a check-button is set to invisible. And while invisible, I disable the sprite's collision, so that clicking on it will have no effect. But for some reason, I can't disable collisions on the text object from what I can tell.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I believe collision is only for interaction between two objects.

    Safest way to disable click would be to add boolean variable "clickable" into object, and in every mouse click condition also condition which will check if "clickable" variable is true.

    And every action which should disable clicking could switch "clickable" variable to false, and every action whick should enable clicking should switch "clickable" to true.

  • Hmm, ok, I'll try something like that, thanks.

    I still find it strange that an object can be clicked when it isn't visible.

  • if you dont want things to be able to be clicked when not visible add the contrition is visible to your touch event

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