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

Area2D duplicate signal when changing CollisionPolygon2D Polygon property #25769

Open
Tracked by #45334
ghsoares opened this issue Feb 10, 2019 · 4 comments
Open
Tracked by #45334

Comments

@ghsoares
Copy link

Godot version:
3.1 Beta 3

OS/device including version:
Windows 10 Pro

Issue description:
I'm trying to create dynamic 2d water, with damping and dispersion physics in the water surface. The water has Area2D with CollisionPolygon2D to detect RigidBody2D collision to calculate speed and apply force in a surface vertice. But the CollisionPolygon2D has the same poygon as the body (note: the water body and surface is drawed, not using a Polygon2D), so every frame is changing. But when a body enter the water, duplicate the "splash" function, but when the Collision is not changed, the "splash" function is called once.

OBS: I already tried using _physics_process(delta) function in instead of _process(delta) function to change the polygon, but the signal output more.

Steps to reproduce:

  1. Create a Area2D;
  2. Create a CollisionPolygon2D as child;
  3. In a script, every frame change the 'polygon' property of the CollisionPolygon2D;
  4. Connect the 'body_entered' signal to the script;
  5. To analyse the output, put a print function on the signal;
  6. Put a RigidBody2D (or other body falling to the Area2D) on the scene;
  7. Run the scene.

Minimal reproduction project:
collision duplication.zip

@spikestheraccon
Copy link

I have same issue when I use Animation Player and change polygons dynamically. At the end of animation I tried to disable collision, but signal still emit. It makes impossible do "slashes" with Area2d+CollisionPolygon2d

@KoBeWi
Copy link
Member

KoBeWi commented Nov 6, 2020

Still valid in 3.2.3

@Zylann
Copy link
Contributor

Zylann commented Jul 2, 2021

Similar to #19271?

@ghsoares
Copy link
Author

ghsoares commented Jul 2, 2021

@Zylann It seens that both issues is occurred by the same bug, so yes

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

5 participants