Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change scene on InputEventJoypadMotion in _input(event) disconnects joy controller #55098

Open
toralfno opened this issue Nov 18, 2021 · 8 comments

Comments

@toralfno
Copy link

Godot version

v3.4.stable.arch_linux

System information

Arch Linux 5.15.2-arch1-1

Issue description

If i call on change_scene() in _input(event): if event is InputEventJoypadMotion the controller disconnects.

func _input(event):
	if event is InputEventJoypadMotion:
		get_tree().change_scene("res://Scene.tscn")

It don't happens on InputEventJoypadButton. And if i add a Timer before the change the controller stays connected.

I have a Global scene that is autoloaded to monitor controllers.

Steps to reproduce

Run project and press an analog input on your controller and joy_connection_changed() will print out the device that disconnected.

Minimal reproduction project

Controllerbug.zip

@Calinou
Copy link
Member

Calinou commented Nov 18, 2021

By "the controller disconnects", do you mean the controller disappears entirely from the OS' point of view? Or does Godot just stop receiving all controller inputs (while still receiving keyboard/mouse inputs)?

@toralfno
Copy link
Author

Godot just stop receiving controller input from one controller. If you replay the project the controller is back.

It will receive input from other controllers and keyboard/mouse.

@Calinou
Copy link
Member

Calinou commented Nov 18, 2021

Can you reproduce this in Godot 3.3.4? See also #55037 and #54066.

@toralfno
Copy link
Author

Weird... on 3.3.4 it only happens on L2 and R2 (triggers).

@toralfno
Copy link
Author

Tried on another computer with 3.3.2. Same result as original bug.

@toralfno
Copy link
Author

Setting Input.set_use_accumulated_input to true fixes the problem.

@AgentSmith0
Copy link

Setting Input.set_use_accumulated_input to true fixes the problem.

This also solved my issue: #53334

@akien-mga
Copy link
Member

I'd like to make sure we understand what the problem was here in different Godot version.

Godot 3.3.2 and 3.3.4 mentioned above should both default to input accumulation being enabled, so Input.set_use_accumulated_input(true) shouldn't make a difference there.

Then Godot 3.4+ did regression and input accumulation was disabled by default, so it can make sense that calling Input.set_use_accumulated_input(true) would improve things.

But then I don't understand the report that 3.3.2 seems to have the same bug as 3.4?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants