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

Swapping body's active shape will leave Area2D #79133

Open
KoBeWi opened this issue Jul 6, 2023 · 2 comments
Open

Swapping body's active shape will leave Area2D #79133

KoBeWi opened this issue Jul 6, 2023 · 2 comments

Comments

@KoBeWi
Copy link
Member

KoBeWi commented Jul 6, 2023

Godot version

4.1

System information

Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 30.0.15.1403) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

Issue description

I have a PhysicsBody2D (any subtype) with 2 colliders. One collider is enabled, the other is disabled.
I swap enabled collider:

if swapped:
	%Collider2.disabled = true
	%Collider1.disabled = false
else:
	%Collider2.disabled = false
	%Collider1.disabled = true
swapped = not swapped

The body will exit overlapping area and never re-enter it.

Steps to reproduce

See above and below.

Minimal reproduction project

Physecs.tscn.txt

Press any key to swap colliders.

@markdibarry
Copy link
Contributor

Sounds suspiciously like the same root cause as #61420?

@KoBeWi
Copy link
Member Author

KoBeWi commented Jul 7, 2023

Well this issue has a workaround, something like

enable shape2
wait 1 frame
disable shape1

but it can cause both colliders to be disabled if the timing is unfortunate.

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

2 participants