How to get individual shapes of CollisionPolygon2D

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By epord
:warning: Old Version Published before Godot 3 was released.

Hi, I am using a CollisionPolygon2D. The CollisionPolygon2D is splited in several convex polygons (ConvexShape2D).

→ Is there a way to get all these individual ConvexShape2D?

I saw in C++ code on Github that CollisionPolygon2D has a method Vector<Vector<Vector2>> _decompose_in_convex(); that returns just what I need, but I can’t access it from GDScript.

→ Is there a way to change C++ code, recompile, and access the function from GDScript?

:bust_in_silhouette: Reply From: eons

Those shapes are added to the body on runtime, use get_shape to access them (get_shape_count to know how many they are).