Pause ignores the click

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Kohl

Why pause mode, (get_tree ().paused = true), ignore the clicks? When I pause the game, I click on an object, and I leave the pause, it calls the method click?

I followed the suggestion of the post below. But it did not work!

:bust_in_silhouette: Reply From: 2D

I assume that you are using control nodes for your objects? If so, This is the behavior of the controls nodes.

Try putting an empty control node (input_blocker) the size of your window at the bottom of your scene tree, but above your unpause stuff as shown in the hierarchy below. Make sure the input_blocker is hidden when the game is not paused. It should mainly just be below other control nodes.

–more stuff

Let me know if this works for you.

The click is on a RigidBody object, which is destroyed when it is clicked, with

connect ("input_event", self, "click_event")

func click_event( camera, event, click_pos, click_normal, shape_idx ):
  if event is InputEventMouseButton and event.pressed:

I made a video that shows the moment I clicked on RigidBody, with the game in pause mode. >>link to the video

Kohl | 2018-05-15 11:46