I’m trying to develop a “snake-like” game with dog models in 3D. The idea is that the more treats you eat, the longer the dog boddy elongate.
So my plan is to cut the 3D model in half and find a way to join the two body parts together in game.
For the moment, I just use a capsule model that I instantiate along an array of Vector3 :
You could do this with rigging and bones. You’ll need to add lots of ring loops to the mesh around the dog’s torso and add lots of bones along its spine.
You can set the spine bone of this dog to the longest length at the model stage. For every food it eats, set one more spine bone length to be the normal bone length.
Finally, perhaps you could also rely on ChainIK to achieve its movement.
Thanks all for your suggestions, it realy helped me on my research !
I looked into the rigging idea but I’m not charmed by playing with bones and have a monstruous amount of ring loops on the model
I also looked for ways to create those “endless racer” games and that put me on the way of the new Splines system that Unity released in January !
Using my previous array of registered player’s positions, I managed to instanciate knots according to that, then create the mesh along the spline with the “Spline Extrude” Unity script
I can also easily control the resolution of the cylinder.
Now I still need to optimize my script for saving the player positions because for the moment it saves the player position on each frame, then update the position of each knots, meaning that the game start lagging the more I add knots to the spline… (issue that also apply for my fist post)