You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a very simple scene named "moving_area_2d". It just moves to the right slowly and prints a message if it enters another area2d. This scene hierarchy is just:
Node2d
Area2d
CollisionShape2d
In my main scene, I have only two nodes: An instance of moving_area_2d, and an area2d that is sitting in it's path. I connect the area2d's "area_entered" signal to a print message. So what I expect should happen is once the moving area collides with the static area, both areas print a message. Instead, only the moving area 2d prints anything. The static area 2d never has it's "area_entered" signal emitted. The strangest part is that if I recreate the project from scratch, then it works. So something about this existing project is "corrupted" or something?
Steps to reproduce
Run the attached MRP. Enable "visible collision shapes" to see the two rectangles. Only one line of debug output is printed, instead of two. Also attached is an essentially identical project that was created from scratch that does not exhibit the same bug.
If you open area_2d_test's main.gd file in the script editor, you will see that your _on_area_2d_area_entered isn't connected to anything (no signal connected symbol). Then, if you look inmain.tscn, you will see that you are attempting to connect a function called _on_static_area_2d_area_entered to StaticArea2D's area_entered signal. If you change this line:
Hey Cosparks. You're right, it seems that I made some mistakes as I was trying to pare this down to an MRP. I've found the real source of the issue in the original project, and it really has nothing to do with what I've detailed here, so I'm closing this out. This was really just user error, so it probably wasn't worth raising an issue over to begin with. Sorry about that :/
Tested versions
Tested in 4.2.1, 4.2.2, and 4.3 dev6
System information
Godot v4.2.1.stable - Windows 10.0.19045 - GLES3 (Compatibility) - NVIDIA GeForce GTX 1080 (NVIDIA; 31.0.15.3734) - AMD Ryzen 9 7900X 12-Core Processor (24 Threads)
Issue description
I have a very simple scene named "moving_area_2d". It just moves to the right slowly and prints a message if it enters another area2d. This scene hierarchy is just:
In my main scene, I have only two nodes: An instance of moving_area_2d, and an area2d that is sitting in it's path. I connect the area2d's "area_entered" signal to a print message. So what I expect should happen is once the moving area collides with the static area, both areas print a message. Instead, only the moving area 2d prints anything. The static area 2d never has it's "area_entered" signal emitted. The strangest part is that if I recreate the project from scratch, then it works. So something about this existing project is "corrupted" or something?
Steps to reproduce
Run the attached MRP. Enable "visible collision shapes" to see the two rectangles. Only one line of debug output is printed, instead of two. Also attached is an essentially identical project that was created from scratch that does not exhibit the same bug.
Minimal reproduction project (MRP)
area 2d test.zip (Exhibits problem)
area2dbug.zip (Works correctly)
The text was updated successfully, but these errors were encountered: