-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Adding a CollisionShape2D node crashes Godot #76618
Comments
I had this exact same issue now when trying to add custom code to my engine build in 4.0 branch, does it also crash by simply adding the CollisionShape2D as child of any node? I have a suspect that the |
Good catch! It actually is adding the CollisionShape2D to any node or scene, not just Area2Ds that is causing the crash. Updated bug report to reflect |
Ok, I think I've found the issue, in So the issue isn't with the CollisionShape2D node, but with the editor plugin that edits it. By making the edit function set godot/editor/plugins/collision_shape_2d_editor_plugin.cpp Lines 377 to 415 in fdf66b3
It should have shape_type = -1; on line 395, like this:
current_shape = node->get_shape();
if (current_shape.is_valid()) {
current_shape->connect(SceneStringNames::get_singleton()->changed, callable_mp(canvas_item_editor, &CanvasItemEditor::update_viewport));
} else {
shape_type = -1; // Here
return;
} |
@KoBeWi Could you confirm? |
Duplicate of #76543 (workaround in comments)
This is not needed. The crash only happened, because the initial value set in constructor was |
Godot version
4.0.3
System information
Linux Mint 21.1 Cinnamon
Issue description
Adding a CollisionShape2D crashes Godot Engine.
Crash replicated across scenes and projects. Completely fresh projects crash as well.
Steps to reproduce
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: