CollisionPolygon with predefined shapes just like CollisionShape Available on Godot Asset Library
Author | Jakub Kubulambula Janšta |
Version | 1.1 |
Godot Version | 3.4+ |
License | MIT |
Godot's Shape node is very useful, but for example if you want to find the area of intersection between two shapes you would most likely use the Geometry singleton.
But this uses polygons as PoolVector2Arrays and CollisionPolygon2D node does not have shape presets while CollisionShape2D does not have it's polygon exposed.
This plugin addresses this issue by ading new CollisionPolygonShape2D Node and PolygonShape2D Resources
- Just create a new CollisionPolygonShape2D Node like any other (under CollisionPolygon2D) and in the inspector add a PolygonShape2D just as if it was CollisionShape2D.
- The Node functions just like CollisionPolygon2D.
- If you want to get the PolygonShape2D's polygon just call
get_polygon()
method on it returning PoolVector2Array.CollisionPolygonShape2D.shape.get_polygon()
This plugin is released under the MIT license. See LICENSE
There is no warranty for any issue or bug that may break or corrupt your project.
It is advisable to keep a copy of your project.