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

Collision shapes created through CollisionObject2D APIs are not visible #36499

Open
Tracked by #45334
udit opened this issue Feb 24, 2020 · 2 comments · May be fixed by #59516
Open
Tracked by #45334

Collision shapes created through CollisionObject2D APIs are not visible #36499

udit opened this issue Feb 24, 2020 · 2 comments · May be fixed by #59516

Comments

@udit
Copy link

udit commented Feb 24, 2020

Godot version: 3.2

OS/device including version: Windows 10

Issue description: Collision shapes created using CollisionObject2D APIs work but are not visible on enabling "Visible Collision Shapes".

ezgif-6-739f6b2d1364

Steps to reproduce: Create collision shape using shape_owner* APIs

	var own = create_shape_owner($Child)
	var shape = CircleShape2D.new()
	shape.radius = 20
	shape_owner_add_shape(own, shape)

Minimal reproduction project:
CollisionVisibilityBug.zip

@Xrayez
Copy link
Contributor

Xrayez commented Feb 24, 2020

CircleShape2D (and any other shape) are resources so they can't be drawn outside the scene tree if they weren't assigned via CollisionShape2D node in editor which actually enables editor/in-game visibility on them.

When you add those shapes via shape_owner* API (or even with Physics2DServer) it means that they are added to CollisionObject2D directly bypassing CollisionShape2D.

The solution might be that it's better to draw those shapes directly and not only via CollisionShape2D.

@Xrayez
Copy link
Contributor

Xrayez commented Apr 29, 2020

I have a PR which can help this on the scripting side: #37903, but doesn't solve the underlying issue.

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.

3 participants