I am trying to make snake, but i can't seem to get the other parts to follow correctly
Provided the parts of the snake each retain which part it follows, you only need to keep the head and the tail parts in fields. Never move the "body" of the snake. When moving, replace head with a body part and move head. Then, only if not eating, remove tail piece (the tail field needs updated first to the piece the tail follows).