0 votes

The most promising thing I've found so far is the debug_collisions_hint property of SceneTree. However, it seems to be a bit finicky: If I set the field to true inside of _ready(), then collision shapes will be visible. But if I try to change its value later (in _unhandled_key_input() specifically), nothing happens.

I just need this for debugging purposes, but it'd be nice not to have to close the game, manually toggle the option, and restart the game every time.

in Engine by (23 points)

1 Answer

+1 vote
Best answer

generally, visible is a base property, you can easily setup using signals or user actions (keys, mouse, etc..) and then, toggle hide/show with:

visible = !visible
by (107 points)
selected by

Thanks, that seems to work! It's not an ideal solution since I still need to iterate over every CollisionPolygon2D and CollisionShape2D object, or place each of them in a group. But it will do for now.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.