Help with a Segmented dragon enemy

Godot 47.1

Question

I am trying to make a segmented dragon enemy that behaves Pretty much like to wyvern from terraria but i just cant figure out how to do it i have tried a head and segment scene but i couldn’t get that to work, so does anybody know how to do this?

Maintain a list of head’s transforms from last N frames, and assign each of those transforms to a segment.