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

Debug visible collision shapes does not show collision shapes created via shape_owner methods #47537

Closed
ghost opened this issue Apr 1, 2021 · 3 comments

Comments

@ghost
Copy link

ghost commented Apr 1, 2021

Godot version:
3.2.3.stable

OS/device including version:
Window 10 Professional, Version 20H2, Build 19042.804
AMD Ryzen 3700X CPU with X570 chipset
Nvidia RTX 2070 GPU
GLES3

Issue description:
Collision geometry created at run time (using the shape_owner methods) was not visible when the debug setting "visible collision shapes" was enabled. Collision geometry created in the editor before hand was still visible. If I add the collision shapes at runtime using CollisionShape nodes (which causes errors since those are only meant for the editor), then those are still visible.

I expected the collision geometry added at runtime to also be visible.

image
Here is a picture of what I saw. The purple cube has a blue outline from it's collision shape. The red object below it has no such outline.

Steps to reproduce:

  1. Create a new scene with a plain Node as the root.
  2. Add two children: A RigidBody and a Camera. Turn off gravity for the rigid body
  3. To the RigidBody, add a MeshInstance with a simple CubeMesh
  4. Add a script to RigidBody. In _ready(), create a new shape owner, and add a shape to that owner (any Shape resource will do, preferably something that matches the visual object used). Code example:
func _ready():
    var NewShapeOwner = create_shape_owner(self)
    shape_owner_add_shape(NewShapeOwner, shape_resource)
  1. Enable "Visible Collision Shapes" in the debug menu
  2. Run the scene. If the bug has successfully been reproduced, you wont see the collision shape outline.
  3. You may confirm that the collision shape really is present by adding another RigidBody with a premade collision shape, and colliding it with the first RigidBody

Minimal reproduction project:
The scene to run is called "World" under res://Src/World
Mesh Test.zip

@Calinou
Copy link
Member

Calinou commented Apr 1, 2021

This is the same issue as #36499 but for 3D.

@trollodel
Copy link
Contributor

This is no longer an issue after #46397.

@Calinou
Copy link
Member

Calinou commented Apr 2, 2021

Closing per @trollodel's comment. This should be fixed in 3.3.

@Calinou Calinou closed this as completed Apr 2, 2021
@Calinou Calinou added this to the 3.3 milestone Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants