Placing an object's body parts on a curved line

Hello all, I’ve been wondering about this for a long time and I can show you some examples about it for you to understand my question better. Let’s say in Songs for a hero game there is a scorpion boss and it’s tail moves as I described in title.

✂️ Scorpion - YouTube (I don’t own it)

Or in another game there is a robo snake (or something like that) which it’s body parts moves together like in my first example

Can you please inform me about this subject, I want to use this mechanic in my game :slight_smile:

I would try using the “SineMovement” extension that you can search for under Functions/Behaviors inside of GDevelop. You can add the behavior to your snake body objects with vertical distance = 0, but horizontal movement = some number, depending how far you want the body segments to move.

This will make the body objects move back and forth horizontally. However, they will all be moving together with the same x position. You’ll need to get them to move back and forth with a different timing so that they form a snake.

To do that, try using the “Reset sine progress counters” action that the Sine Movement behavior provides. You can use an object timer for each body object with a different delay for each object to reset the sine progress. (so, use 0 second timer for first object, .1 second timer for second object, .2 for third etc.)

1 Like

thanks luxan I will share my progress soon :slight_smile: