Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Could someone help me with my snake model?

A topic by 7heWizard created Feb 17, 2020 Views: 265 Replies: 2
Viewing posts 1 to 3

So, I've made a snake controller that mostly works, but the snake is composed of multiple balls, which doesn't exactly look good and is prone to letting stuff through it. I would like to have a mesh and a mesh collider around it, but I have no clue how to do that. I couldn't find a tutorial about it, so if someone could give me advice or forward me to a tutorial, that would be much appreciated.


Here's a picture of the snake.

(4 edits)

If the balls are always a similar distance apart, just parent some thin Cube Colliders to the back of each ball and program each ball to always face toward the previous.

For the model - how good are you in Blender?  I'd make a single segment in Blender with one or two bones that aligns itself, again, with the previous segment, like so:

Make sure each bone's vertex group has full weight on its end only:


You could also add a texture from here.  After unwrapping it with some seams, I painted it with a simple pattern, using an array modifier to make the texture repeat smoother.


Export as FBX.  In Unity, just instantiate some of these at every ball, making the "front" bone point at the next ball and the "back" bone align with the one you instantiate it at/parent it to.  I haven't tested any of this in Unity, however.

You can probably download the .blend file here.

Hey, thank you a whole lot for the help.

 

The graphics are working fine, but I still have a problem with the snake going through stuff. I tried adding a collider to the back of each object, but this tends to happen:

Then I tried putting a collider in front of the balls, but that resulted in some weird behaviour with the controller.