Godot Version
4.3 stable mono
Question
In my game, the players have tools that they can swing around them in a circular arc. To make sure they collide even when rotating quickly, I’ve made a custom collisionpolygon2d that gets updated every frame to be a concave shape (an arc with a definite thickness).
However, I want to execute some code when they hit CERTAIN tiles of a tilemaplayer, and thus, I’m trying to figure out a way to make them collide.
Unfortunately, I cannot find any way to make the two mesh when checking collisions for tiles, for the following reasons:
- ConcavePolygonShape2D works with line segments, and thus might have tiles pass through it when swinging quickly (which is what I was trying to avoid), and it doesn’t have a Collide method or inherits from something that does (i. e., shape2d)
- CollisionPolygon2D doesn’t have Collide stuff, same as ConcavePol.
- ConvexPolygonShape2D obviously doesn’t capture the whole shape, which I would like to avoid
- This updates every frame to a shape that changes in size and arc, so it would be impractical and inefficient for it to be split into multiple convex shapes, that could change in number and form
- I’m trying to detect which tiles border an empty tile, so I feel like this would be the best option instead of making 4 separate tilemaplayers for each border to detect collisions with
Any suggestions about any step of this process are welcome.
Any ideas?