Skip to main content

Posts

Showing posts from August, 2017

2D dynamic mesh snake in unity

This post is about me starting a project with snake character in Unity3D and finally realizing how bad of idea it was. This is a final product of the project: The idea was to make a snake out of segments and generate a continuous mesh on top of it, in this fashion: Design assumes each segment to have its own rotation and rigidbody2D and to be connected with  Hinge Joint 2D to previous segment, with controllable player head being the first one. I recomend using Catlike Coding tutorial for generating basic mesh .  First step I took was to generate one quad per segment on its position. Because Mesh generating script was attached to snake's head and I didn't bothered with rotation at first, it gave really nice, unusual effect. It's probably the best it looked during the whole project. Rotation was fixed by simply copying rotation transform from each segment to its quad. And it still looked cool. Then I proceeded with filling the gaps with new g...