Topic was automatically imported from the old Question2Answer platform.
Asked By
Tran Hoang Nhat
Old Version
Published before Godot 3 was released.
Is it possible to copy an array created by ArrayPropertyEdit as code? I’m looking for a way to create CollisionPolygon2D dynamically, since now I have to edit it in the editor, type the polygon points array by hand, and then create a ConvexPolygonShape2D from that array, which is very cumbersome. Thanks.
You may try get_polygon() and set_polygon(Vector2Array polygon) of the CollisionPolygon2D node.
Can I access CollisionPolygon2D in the game? In the doc it said This is not present when running the game. so I’m a little confused. And I can’t copy text from the console neither. So many thing is not copyable in Godot.
Tran Hoang Nhat | 2016-10-06 03:11
Figured it out. I have to launch Godot from Terminal to get properly console output. Now I can copy those values!
I also just found about EditorScripts which (among many things) can be used to add shapes generated via code to the scene, check out SVG2Godot as an example.
(I procedurally create shapes and use an EditorScript to add them as 2D Polygons to the scene so I can tweak them manually if needed)