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

Separate Viewport/World2D with another viewport sharing the World2D causes physics errors, no rendering #52423

Closed
Tracked by #45334
spacechase0 opened this issue Sep 5, 2021 · 2 comments · Fixed by #57179

Comments

@spacechase0
Copy link
Contributor

Godot version

3.3.3-stable_mono_win64

System information

Windows 10 (64-bit) , GLES 3, Nvidia RTX 3080

Issue description

I'm using separate Viewports and World2Ds to have separate locations with their own physics and such. So what I'm doing is having a node containing each location as a Viewport with their own World2D, and then for the "player" viewport (the one currently rendering) I set it to use the same World2D. (Optionally with a Camera2D being moved using RemoteTransform2D, but that wasn't necessary to demonstrate the issue in the test project.) This causes some things not to render (MeshInstance2D at least; in my actual project one of the sprites is rendering, but not the other.), and this error to be repeated:

ERROR: body_test_motion: Condition "!body->get_space()" is true. Returned: false
   At: servers/physics_2d/physics_2d_server_sw.cpp:1046
ERROR: body_test_ray_separation: Condition "!body->get_space()" is true. Returned: false
   At: servers/physics_2d/physics_2d_server_sw.cpp:1058

I've confirmed that the viewports and their children all have the same World2D instance being used with print and str.

I've used the same setup before, except in 3D, where it worked fine. In the minimal reproduction project, I included a 3D version, which works fine.

Steps to reproduce

The minimal reproduction project has everything set up already, with the startup scene that causes problems, PlayScene2D. You can change the startup scene to PlayScene3D to see the 3D version that works fine.

Minimal reproduction project

LocationTest.zip

@spacechase0 spacechase0 changed the title Separate Viewport/World2D another viewport sharing the World2D causes physics errors, no rendering Separate Viewport/World2D with another viewport sharing the World2D causes physics errors, no rendering Sep 5, 2021
@spacechase0
Copy link
Contributor Author

Looks like the same behavior in release 3.1.2. My test project wouldn't load in 3.0.x.

@akien-mga
Copy link
Member

Fixed by #57179.

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