How to use Kinematic Collision detection coupled with animation?

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

I have a silly question. I am working on creating a simple vertical shoot em up. I have a kinematicbody2D as a parent with an animatedSprite, animationPlayer and collisionPolygon2D as children. I want to make a collision map that also works on all the frames within the animation. Do I need to make a collision map for every seperate frame(if yes, how?) or can I just tweak my already existing collisionpolygon2d?

:bust_in_silhouette: Reply From: Tybobobo

I personally just animated the collisionPolygon at the same time as the sprite itself. I hope there is a better way of handling it though. Not sure if adding the collision as a child of the sprite would work; since when animating the sprite the collision should move with it - but I have not tested this yet.

To add more animation properties (or whatever they are called);
After you have the animation window open (at the bottom) navigate to the collisionPolygon2D and click the + button at the right of the properties you wish to animate, in order to add it to a frame. That should add them to the animation window.

:bust_in_silhouette: Reply From: Kermer

Create multiple CollisionPolygons2D,
Set “Is trigger” to true for unused (meant for other frames) polygons,
Add “Is trigger” keys from those polygons to your animation to turn them on/off.