Open bpm-mcgill opened 4 years ago
Looks like #189 . Do you not get a traceback when this happens? What OS are you running on? In linux I got this crash when compiling godot with LLVM/Clang but not GCC, so if you can try building godot from source with GCC.
"Do you not get a traceback when this happens?" Nope, the only thing that is returned is what I gave earlier. "What OS are you running on?" Linux Debian Buster I installed godot with https://godotengine.org/download/linux .
I'll have a crack at this bug again this weekend. Meanwhile, try building godot from source with GCC, or use Input.is_action_pressed / Input.is_key_pressed
Issue still present on version 0.50.0 with Godot 3.2.3.
On Windows 64bit the following code crash the program started :
from godot import exposed, Node2D
@exposed
class Test(Node2D):
def _ready(self):
print("ready")
def _input(self, event):
print("input")
Console output :
Running: C:\xxx\Godot_v3.2.3-stable_win64.exe --path C:/yyy --remote-debug 127.0.0.1:6007 --allow_focus_steal_pid 10576 --position 448,240 res://Test.tscn
Godot Engine v3.2.3.stable.official - https://godotengine.org
OpenGL ES 3.0 Renderer: GeForce GTX 1660 SUPER/PCIe/SSE2
Pythonscript 0.50.0 (CPython 3.8.5.final.0)
ready
input
You can notice that _input
method is called once then crash.
More logs now appears :
[...]
ready
input
ERROR: call: Condition "!instance" is true. Returned: Variant()
At: ./core/method_bind.gen.inc:2284
Even if I trigger an exception on _input()
Godot crash.
I observe the same on Windows 64bit. But the crash only happens if the mouse is inside the game window.
Code:
from godot import exposed, export
from godot import *
@exposed
class Main(Node2D):
def _ready(self):
print("_ready")
def _input(self, event):
print("_input")
if event.is_action_pressed("ui_select"):
print("Pressed Space.")
Output in terminal (Windows PowerShell):
1. Play the project:
PS C:\Users\mike> Running: C:\cygwin64\home\mike\Godot_v3.2.3-stable_win64.exe --path C:/cygwin64/home/mike/godot-games/talk-to-python --remote-debug 127.0.0.1:6007 --allow_focus_steal_pid 20116 --position 580,284
Godot Engine v3.2.3.stable.official - https://godotengine.org
OpenGL ES 3.0 Renderer: GeForce GTX 1080/PCIe/SSE2
Pythonscript 0.50.0 (CPython 3.8.5.final.0)
_ready
2. Press Space
:
_input
Pressed Space.
_input
_3. Move the mouse into the game window:
_input
The the game window closes. This final _input
shows up in the terminal, but not in the Godot Editor Output window.
If the mouse is already inside the game window when I play the project, the game window closes immediately.
Workaround for registering a single event per key press using _process()
instead of _input()
:
def _process(self, delta):
if Input.is_action_just_pressed("ui_select"):
print("Pressed Space.")
Still experiencing this issue, and have to use _process()
instead of _input()
as a workaround.
I was making a camera for my character when the game began to close its self. I realized that it was only occurring when I moved my mouse. It would say (before I moved my mouse):
and when I moved my mouse it would add:
--- Debugging process stopped ---
It works with gdscript, but breaks with python. This is all that is needed for this to happen:
Does anyone know why this is happening and how to fix it?