Hey. I want to make a play on the similarity of the hole.io. I was told to use css for the floor and holes. But it works in a strange way. I wrote a script to move the hole and rebuild the collision shape. Now objects either fall into the hole or do not fall into the hole. Although there is a feeling that they fall when I touch the hole edge of the platform. What am I doing wrong? Video: https://drive.google.com/open?id=15di4ZMlDWTNAND7yLVBSz-R_vykw3ko6

It seems like the floor isn't being fully cut through in the collision shape every time. Maybe move the cylinder CSG shape further down into the floor and see if that helps?

I don't know if CSG collision shapes show up or not, but you might be able to see the generated collision shapes by enabling Visible collision shape (or something like that) in the debug panel of the Godot editor.

Other than that, I don't see anything that looks like it would be causing an issue. From what I can see in the video, it does not look like there is anything wrong with the setup or code. If possible, can you provide the project or sample project? I don't know if I'll be able to find a solution, but I might be able to get an idea of what the issue is.

How dense is the floor mesh? If each side is just 2 triangles then that might be your issue. You don't want to go too geometry heavy, but for the CSG to make proper cuts there needs to be a bit more geometry.

@TwistedTwigleg said: If possible, can you provide the project or sample project? I don't know if I'll be able to find a solution, but I might be able to get an idea of what the issue is.

I think that's the attached .rar?

@Megalomaniak said:

@TwistedTwigleg said: If possible, can you provide the project or sample project? I don't know if I'll be able to find a solution, but I might be able to get an idea of what the issue is.

I think that's the attached .rar?

Somehow I totally missed the attached .rar in the OP! I’ll download it and see what I can figure out soon.


Edit: Downloaded the .rar, and indeed it is the project.

After playing around with various different settings, options, node arrangements, and scripts, I think the issue is a bug. Everything I tried didn't result in any consistently working results. The only thing that sort of worked was adding a CSGBox with Subtraction to trip a bit of the bottom of the floor CSGBox node, but this didn't always fix the issue.

It might be worth opening a GitHub issue, if there is not one already opened.

6 days later

I wouldn't make a hole.io game with CSG.

Instead I would change the collision flags on objects as you hover over them so they no longer collide with the floor, but instead an invisible ring (so they bounce of the edge.)

Then for the image of the hole you might perhaps render to a texture to make it look like there is hole there. perhaps.

I don't know if my cheats would work, but that's how I would get started.

@Calinou said: @TwistedTwigleg I think this is already reported, see #21125 on GitHub.

Interesting. That does look like it is related, though I'm not sure it is the same issue.

The issue in #21125 seems to be the opposite problem, where faces that are supposed to be there are missing, while the problem in this project seems to be faces that are supposed to be missing are still there. As far as I can tell, it seems bottom face of the CSG is not always subtracted by the CSG shape.

That said, I'm not very experience with CSG shapes in Godot and have only messed around with them a little bit, so it might be they are entirely related and I'm just misunderstanding the issue.

3 years later