How to make a Snake-like movement?

Hy all,

I am in the creation of a game where main actor is a snake like figure that flies through the space.
Currently I am using Constraint components to keep the elements together but they look more like waggling rather than body parts following each other.

I was also thinking about maybe turning it into a simple follow>>follow>>follow system, but im not sure if that would be performance wise. I guess with a skeletal approach I would be at the same spot as with the constrains.

I see, nobody has any ideas…

I have changed my concept a bit, and now I am using the Lerp function, and also opened another thread to discuss what is the most performance friendly solution here :

Ok, so this is maybe a crazy Idea, BUT you could try using a sine to feed the world position offset of vertices using their current position in the snake’s material. I haven’t tested anything like and this is just something out of my head but it may give you some insights.

Thank you Luiz!!!

Im really happy to recieve your idea and it is exactly the out of the box way of thinking that I am also trying to do every now and then.
This is probably pretty cost effective ecpecially on the CPU!
The only problem I see with this is the collision detection on each unit (which I did not mention in my description :frowning: ).
I just had another idea yesterday: I might try to use a spline/bezier curve arrange the pieces equally while I am updating the spline ever x frame ( chip off the last piece and add a point where the “head” is @ ). However I heard once that the Array functions like this cost a lot… however there would only be one slightly heavier calculation instead of 10-15 lerps at the same time…

Why don’t you make the snake in a 3D modeling package and animate it as a skeletal mesh rather than trying to do it procedurally?

TorQueMoD, yeah it sounds reasonable, and that was my first idea too, but because it is the Pawn and freely controllable it would be really hard to achieve the same result. So just to make it clear the head component is controlled by the forward direction of the Camera ( where the player is looking at ). All the rest is following, b3 >> b2 >> b1 >> head . Im sure it might be solvable with an awsome system of Blendspaces, but… well im not an expert in that department. im open for suggestions if you still think its easy to do!

Well, these ideas may be expensive on the CPU, but does it matter? Is there going to be a lot of other stuff and is the game pretty heavy? Because if it isn’t, you could try some of them just to see how it works into your gameplay.

well its on Android and not the newest model, so every ms counts.