I try to recreate this type of movement ( snake ) from old game Volfied. Any idea how to implement this
The red snake in stage 14
Thanks in advance
I try to recreate this type of movement ( snake ) from old game Volfied. Any idea how to implement this
The red snake in stage 14
Thanks in advance
You rotate the head the direction its moving.
Which is quaternion.lookrotation(target position - current position).
At an interval or based on a minimum move distance, you add the head’s current position to a list of points.
You have an array of body segments. Each segment wants to be at its corresponding point in the list of positions, it lerps toward it. So the first body segment wants to get to position[0], the next body segment lerps towards position[1], etc down the array.
Then you can simply append positions to the front of the list and have the body segments still target their corresponding index, they will constantly have a point to move towards. Once you have the same number of positions as segments, when you add a new one to the beginning you remove one from the end.
End result: Imgur: The magic of the Internet