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

CSGShape doesn't have physics material #36893

Closed
Tracked by #45333
Saitodepaula opened this issue Mar 7, 2020 · 11 comments · May be fixed by #59386
Closed
Tracked by #45333

CSGShape doesn't have physics material #36893

Saitodepaula opened this issue Mar 7, 2020 · 11 comments · May be fixed by #59386

Comments

@Saitodepaula
Copy link

Saitodepaula commented Mar 7, 2020

Godot version:
3.2 Stable

OS/device including version:
Windows 10 Home

Issue description:
I think it is not a bug exactly, but the way CSGShape is designed. But in the way it is now, it doesn't have a physics material, although the docs says it will act like a static body if use_collision is on.

I understand that, as prototype tool, maybe a physics material is not needed. But there is no easy way to create a mesh out of a CSGShape, and reading #19232, it looks like CSGs need more features to be actually useful as prototype tools.

So, all this considered, I think that the fact the engine lets you easily add a collision shape leads the user to think that a physics material is possible.

Also, where is the collision shape added when you click use_collision and how can it be accessed? Because a raycast only intercepts the CSGShape (see below, step 5), shouldn't it be intercepting a physics body?

Steps to reproduce:

  1. Add a path, add some points to get a shape
  2. Add a CSG Polygon as child of paht. Set mode to path, and path node to the parent path. Set Use Collision on
  3. Add a Raycast, place it in a way it intersects the CSG Polygon
  4. Add a script to the raycast, and in the func _process(delta) add print(self.get_collider()) and print(self.get_collider().get_physics_material_override())
  5. Run. It will print [CSGPolygon:XXXX] and then an error of non existent function for get_physics_material_override()

Minimal reproduction project:
CSGStaticBodyTet.zip

@Zireael07
Copy link
Contributor

I just tried to use a CSG polygon as a tunnel, and in spite of checking use collision, my cars aren't colliding with it, not in 3.2 and not in 3.2.1 rc1. So use_collision seems weird either way.

@Calinou
Copy link
Member

Calinou commented Mar 8, 2020

@Zireael07 Can you take a screenshot of the tunnel with Debug > Visible Collision Shapes enabled?

@Zireael07
Copy link
Contributor

Done :)
No collision shape visible.

Screenshot_20200308_145708
Screenshot_20200308_145735

@Zireael07
Copy link
Contributor

I found a workaround, basically this: #19232 (comment) and body.create_trimesh_collision() (from code) or Mesh -> Create Trimesh Static Body (in editor) but use_collision seems broken on 3.2 stable onwards.

@Calinou
Copy link
Member

Calinou commented Mar 8, 2020

@Zireael07 Can you reproduce this in any 3.2 alphas/betas/RCs? You can download them here.

@Zireael07
Copy link
Contributor

Same problem in beta1 (and all subsequent betas).

Beta 1 :(
Screenshot_20200308_154755

Alphas throw a hissy fit about indentation in one of the other files, and as far as I can see the line in question has no spaces but tabs, so IDK what their problem is.

I copied just the csg scene to a new project, opened it in alpha 1, and well... no collision shapes shown. (Making some sort of a character to check if it clips would take more time than I currently have, sorry)

Screenshot_20200308_155329

@Zireael07
Copy link
Contributor

(I realize we've essentially hijacked someone else's bug report, but it looks like they're connected extremely close - alternately, I think you people can move bug reports around? I unfortunately can't...)

@Saitodepaula
Copy link
Author

@Zireael07 hehe, it's fine for me. Like I said, I'm not sure it is a bug I have reported, more a matter of features that are not there by design, but would be extremely useful.

@madmiraal
Copy link
Contributor

Related to #22246.

@lexum0
Copy link

lexum0 commented Mar 12, 2022

I made this tool plugin to work in the meantime with Physics Materials using CSG nodes in case anyone is interested

https://github.com/lexum0/CSGExport-Godot

@Calinou
Copy link
Member

Calinou commented Aug 28, 2023

Closing in favor of godotengine/godot-proposals#7568, as feature proposals are now tracked in the Godot proposals repository.

@Calinou Calinou closed this as completed Aug 28, 2023
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