# Help with a snake like movement

I am looking for an algorithm that moves an object at a regular speed in a snake-circular like movement. This movement should look pseudo-random and smooth, later on I am going to add other body parts, but so far this is the essential.

My try so far has consisted in having a random value t that chages each frame:

t= Random.Range(t-20f,t+20f);

and according to it I was employing a direction. The result should be more directions that are smoothly different, so that the movement itself is smooth.

I would score the solution with 7/10, and moreover, it doesn't describe like short circles, but rather larger ones and the negative result is that the object exits the scene quite fast.

What is your algorithm solution? On the internet I found solutions where the player moves the head of the snake, but here the object acts like an autonomous object.

• It's not entirely clear to me what kind of movement you want. Are you able to include or link to an animated example, or perhaps a diagram showing a desirable sequence of movement states? Geometry problems almost always benefit from visual examples. ;) – DMGregory Mar 29 '17 at 19:18
• google.ro/… – Andrew Stef Mar 29 '17 at 19:45
• Imagine that the object does this by itself – Andrew Stef Mar 29 '17 at 19:45