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

gizmo.add_collision_triangles() & gizmo.add_collision_segments() Only Work When add_mesh() Is Called #68935

Closed
Kalcen opened this issue Nov 20, 2022 · 3 comments · Fixed by #94553

Comments

@Kalcen
Copy link

Kalcen commented Nov 20, 2022

Godot version

v4.0.beta4.official [e675154]

System information

Windows 10

Issue description

I noticed that add_collision_triangles() and/or add_collision_segments() only work if add_mesh() is used in the same _redraw(gizmo): function. I don't want to render a mesh, so I guess I could make the material not render at all, but I would still like to have a selectable collider for the gizmo.

Steps to reproduce

Download the plugin, enable it, and place a Test Node into a 3D scene. The gizmo.add_mesh() function is located in the test_gizmo_plguin.gd script. If you comment it out, the gizmo's collider mesh is no longer selectable in the scene view.

Minimal reproduction project

gizmo_selection_issue.zip

@Calinou
Copy link
Member

Calinou commented Nov 21, 2022

Related to #53083.

@TomCatFort
Copy link

This issue caused me quite the headache.
Many thanks for @Kalcen for finding a workaround with add_mesh() and an invisible material.

I also noticed that the added workaround mesh needs to 'contain' or 'cover' the triangle mesh, otherwise the parts of the triangle mesh that are outside of the workaround mesh remain unselectable.
I assume, the engine first checks if the workaround mesh itself is clicked on, and only then checks the triangle mesh itself.

@juanjp600
Copy link
Contributor

I decided to look into this and come up with a fix. The MRP given here appears to work correctly with #94553 applied when the add_mesh call is removed.

@akien-mga akien-mga added this to the 4.4 milestone Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants