Exporting a Shape2D for a modular interactable object, how do I preview the shape in the editor

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ForsakenBacon

I’m quite new to Godot and just playing around to learn.

I’m trying to design a simple generic interactable object, that has an Area2D I’m using as a Player Collider (using signals). The interactable object will be saved as a Scene, then use Signals to trigger interactions on other objects.

I’m trying to export the Shape2D used by Area2D’s Collision Shape. So that way I can resize it depending on the object’s use case. E.g. one might be a button with a small size, another might be a chest with a bigger size. I also don’t want to be locked to one shape type (circle or rect).

So my question is: To make it easier for development, how can I see my exported Shape2D size within the editor? Like what’s visible when editing with the CollisionShape directly. I know Unity has Gizmos, so I guess I’m looking for something similar.

Or is there a better way to access an instanced scene’s CollisionShape?

When you create something via code, you have to give it an owner and make it a child node to some other node for it to appear in the editor.

The owner is usually the root node in the scene and any other node in that scene can be a parent to your node.

Not sure this is what you are looking for but it does no harm to try.

magicalogic | 2023-02-11 06:09

Its a good point in the right direction. But to create the shapes in code, I still need to see the preview of it in editor. Thats the part I can figure out.

ForsakenBacon | 2023-02-11 07:54