CollisionPolygon2D not animating

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

Hi, I’m trying to animate collision polygon 2d using animaton player (in godot 2). With visible collisions turned on while running the game I can see polygon shape changing as expected, but collision detection doesn’t update (stays as in frame 1). So far the only way around it that I found is making a new polygon for every time I want to change polygon shape. Is there a better way to do it?
Also, I found this tutorial where pixel perfect collision is achieved using masks. Can something similar be done in godot?

Are you sure you set up your animation correctly? Are all the keyframes placed alright?

DodoIta | 2017-12-18 10:44

I’m pretty sure that the animation is done right, I’ve made around 20 in this one project and so far no problems with any other option, just the polygon shape (as I said, the shape changes but collision detection area doesn’t update at all).

dejvid_bejlej | 2017-12-20 14:31

I got the same problem, too.
I’m working on a player’s ability which is simply generating a black hole.
The animation goes like scale up from a tiny point and expand to a circle-shape.
I animated both sprites and shape2D, but it had no effect
(which absorb things to its center) until the expand animation ends.

BIGbirddy | 2018-02-16 18:47

I’m able to animate my collision polygons, and they (somewhat) work, but I’ve found that sometimes the polys are in the original place/shape despite being switched via script AND the polygon shapes are showing up as the animated version that I want when “Visible Collision Shapes” is checked. I think that this is a bug. (I’m still using Godot 2.15, BTW).

I also made sure to have the actual coordinate position set at exactly x 0, y 0 and only have my frames change the actual polygon point positions. Maybe there’s a loop I’ve created where the Area 2d that is sending my collision signals is being bypassed – hence why they work some of the time. My game will not work without animated polygons, so I’m stuck until I find a solution. (Hopefully I won’t end up having to (re)learn C++ and fixing then compiling the durn engine from scratch, and it’s just something I’ve overlooked or there’s a workaround for it.)

gr8grfx | 2019-02-09 07:58