New answers tagged


You need to handle events regularly. Usually that is calling pygame.event.get(). For example: while not done: for event in pygame.event.get(): if event.type == pygame.QUIT: done = True If you are doing nothing with the events, you can call pygame.event.pump() instead.


While the other answers “Hack” a solution for that individual button, it doesn’t fix the overall problem of a click propagating after it’s been detected by a script that uses it. The input system can “consume” events. So that they are used up when required.and don’t get passed on to other objects. For example Event.Use method. There is a good discussion of ...


For me at least, the below solution worked just fine.. Elmar had it almost right. Hope it helps the next person to find this! using UnityEngine; using System.Collections; using UnityEngine.EventSystems; public class PlayerControl : MonoBehaviour { void Update () { if (Input.GetMouseButtonDown(0) && EventSystem.current....

Top 50 recent answers are included