Describe the project you are working on:
N/A (generic issue)
Describe the problem or limitation you are having in your project:
Difficulty to pick out collision shapes, especially when they overlap (it's more pronounced in 2D than 3D)
Tangent: collision shapes and navmeshes/navpolys coexisting in the same project exacerbate the problem even further.
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
Different collision shape colors would help differentiate between shapes, esp. overlapping ones.
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
In the original issue, @Calinou suggested either randomly selecting colors or exposing a custom_color option.
If this enhancement will not be used often, can it be worked around with a few lines of script?:
Not possible to work around AFAIK.
Is there a reason why this should be core and not an add-on in the asset library?:
Can assets even touch debug collision shape setting in any meaningful way? IIRC no.
Original issue: https://github.com/godotengine/godot/issues/31283
Difficulty to pick out collision shapes, especially when they overlap (it's more pronounced in 2D than 3D)
The overlapping issue should be partially addressed by https://github.com/godotengine/godot/pull/34923.
I'll add here the info from my https://github.com/godotengine/godot-proposals/issues/1143 proposal wich focused only in the 3D part of the colision shape.
It propose to show faces with custom color and/or texture and also an "Editor Only" checkbox.
Describe the feature :
- With color/texture customization it will help gamedesigner to see directly what is the purpose of each area and have a readability of the current scene (Differentiate for example "Ladder", "Spawn", "Damage", "Loose" etc...)
- It help to set their size more precisly because you see where they ends when some of the edge are through a wall or something else.
- The Editor Only will let you draw them at runtime without drawing all the other ColisionShape and let you read the screen precisly
Describe how your proposal will work :
- A Checkbox on the Shape (or the Area/Body, need to be questionned) to show the faces.
- Editor standard Color/Shape faces in Editor Configuration. Shape custom Color/Texture to differentiate it.
- "Editor Only" checkbox to see the shape at runtime without showing every shape with the "Visisble Collision Shape" config.
@Calinou @Coldragon There is a similar PR for CollisionShape2D (https://github.com/godotengine/godot/pull/39072).
Do I need to rename debug_color to custom_color for consistency with https://github.com/godotengine/godot/pull/40123?
debug_color is more descriptive and makes it clear this is for debugging purposes only.
@Jummit I just think whether it is necessary to implement the editor_only option.
For quick and fast prototypes or testing mechanics, I often just use CollisionShapes without any graphics and run with "visible Collisionshapes". Unfortunately the only way to differentiate CollisionShapes is via modulation (color value multiplication), and this prevents colors like red to show up. Pretty much the only visually distinguishable choice is green and blue.
I would really really appreciate to be able to choose any color I want for my Collisionshape and also be able to adjust opacity to my liking. This would speed up prototyping by a lot, as in many cases it would make the use of graphics unnecessary while testing mechanics. Even full games could be made without graphics that way. Less nodes, faster production, easier workflow. Therefore I would not want this to be restricted to debug only @Jummit
Alternative proposal (likely the same motivation): #1126.
Basically my idea is to not modify the CollisionShape2D at all and provide a separate node for this. See goostengine/goost#2 where I've already implemented such a node. The idea is that it could work for any node, as long as it has shape property in parent, and not only the CollisionShape2D (I mean, what about CollisionPolygon2D?).
Also see my comment: https://github.com/godotengine/godot-proposals/issues/1126#issuecomment-651185404.
Of course being able to override the color in CollisionShape2D would be faster for prototyping purposes in comparison. But you could also create your custom node with CollisionShape2D/VisualShape2D nodes already instantiated. Both options could co-exist. I haven't considered this option before because you need to modify the built-in nodes to achieve this, and this can be already implemented via plugin/module as you see.
So, you can treat VisualShape2D to be a replacement for a Sprite for collision objects, and it would also (hopefully 馃槃) work once exported (it wouldn't be necessarily tied to debug/editor mode, but I've provided an option to emulate this behavior anyway).
I'll add a small thing : when a collisionpolygon2D (maybe 3D as well I don't know) is disabled it doesn't change visually, unlike a collisionshape2D (which turns gray). It could be nice if they could become grayish, more transparent or something!
Most helpful comment
I'll add here the info from my https://github.com/godotengine/godot-proposals/issues/1143 proposal wich focused only in the 3D part of the colision shape.
It propose to show faces with custom color and/or texture and also an "Editor Only" checkbox.
Describe the feature :
Describe how your proposal will work :