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

GUI in 3D demo not working when when Run On Separate Thread is checked #893

Closed
IvailoBurov opened this issue Mar 22, 2023 · 4 comments
Closed
Labels

Comments

@IvailoBurov
Copy link

Which demo project is affected:

https://github.com/godotengine/godot-demo-projects/tree/master/viewport/gui_in_3d

OS/device including version:

Windows 10, NVIDIA GeForce RTX 3070

Issue description:

When "Run On Separate Thread" project option is checked for Physics 3D a null result is returned at line 128 for get_world_3d().direct_space_state.

Screenshots of issue:

direct_space_state_is_null

@Calinou
Copy link
Member

Calinou commented Mar 22, 2023

As per the description of World3D.direct_space_state:

Direct access to the world's physics 3D space state. Used for querying current and potential collisions. When using multi-threaded physics, access is limited to [method Node._physics_process] in the main thread.

find_mouse() should be called in _physics_process() to resolve this.

@Sauermann
Copy link
Contributor

I believe, that this gets fixed by #925, which rewrites the demo and removes the find_mouse() call.

@Sauermann
Copy link
Contributor

Haven't tested it, but based on the description, I believe, that with #925 merged, this can now be closed.

@Calinou
Copy link
Member

Calinou commented Feb 24, 2024

As of 4.2.1, I can confirm the demo works when Run on Separate Thread is enabled for both 2D and 3D physics since #925 was merged.

@Calinou Calinou closed this as completed Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants