0 votes

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?

in Engine by (21 points)

1 Answer

0 votes

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

by (7,898 points)
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 Frequently asked questions and 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.