Animating Polygon2D Vertices

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By fullmontis

I have been doing some research but I’m not sure if it is possible to animate a Polygon2D vertices. There doesn’t seem to be a way to show each polygon in the side dock, so i’m not sure how I should keyframe the position of the vertices.

Does anyone know if this is possible?

:bust_in_silhouette: Reply From: fullmontis

Okay, the answer was much easier than I expected: I just needed to click on the “Polygon” property in the right side dock when the polygon is selected. The vertices are shown and it is possible to animate them with keyframing

:bust_in_silhouette: Reply From: skysphr

You can add keyframes to the polygon by either going to the Data section and clicking the key next to Polygon or by adding a property track to your AnimationPlayer where the property is the Polygon2D’s polygon. However this will not interpolate vertex movement. If you need that, you will have to script it (for example you can add a number of Position2D nodes as children and have the polygon’s vertices follow them every frame)

however, this will not interpolate vertex movement

Thanks for the answer, I just tested it and it seems like it actually can, which is exactly what I needed. It doesn’t seem like I can animate single vertices independently, but that’s more advanced than the use I need right now

fullmontis | 2022-02-20 08:43

:bust_in_silhouette: Reply From: ChildLearning.Club

To add to the Answer below, it appears at least in 3.5 that the animation player will interpolate the points between the keyframed “Polygon” property, but it requires you to change the default “Update Mode” found to the very right of the keyframes in the AnimationPlayer itself from “Discrete” to “Continuous”