0 votes

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!

in Engine by (34 points)

1 Answer

+1 vote

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 (inputblocker) 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 inputblocker 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.

by (391 points)

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

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.