Unity 3D and Blender’s Curve Modifier, Hard Coding Tank Tracks

The Problem With Tank Tracks in Unity 3D Built Using Blender Curve Modifier

It seems that Unity doesn’t support functions from Blender’s (perhaps any other 3D apps as well) curve modifier.  A few nights ago, I had spent a number of hours perfecting the tracking for a tank that I’m working on for my Super Space Trooper video game.  In Blender, the curve modifier made it really easy to animate the tracks by simply moving the parent object.  Once imported in to Unity I discovered there was no way to do the same thing.  So within Blender I created an animation clip of the tank moving, which would cause the tracks to move appropriately as well.  Unfortunately that also didn’t work in Unity.

After some research I came to the conclusion that Unity simply doesn’t support these types of modifier functions.

Alternative Way to Animating Tank Tracks Within Unity 3D

So as an alternative way of doing it, I’ve decided to instead code the tracks so that they do the same thing.  How will I do that?  My thinking is this:

  1. Get the location of each individual track (tread?) piece of each track and put their locations into an array
  2. Assign the current position as the “start position”
  3. Get the location of the next item in the array
  4. Assign the next item to the “end position”
  5. Lerp between start position and end position over X amount of time
  6. Assign the end position as the new start position and go through #3 to #6 again

It sounds simple enough but I have been struggling with this now for 3 days.  As a matter of fact, I pulled an all-nighter working on it and went to work after that, something I haven’t done since my twenties.

Once I have this code complete, and assuming it works well, I plan to release it on this blog so watch out for that.

Created tank tracks in Unity in the past?  How have you achieved your results?  Leave a comment.

Posted in 3D Animation, 3D Animation, 3D Modeling, Blender, Super Space Trooper, Unity 3D, Video Game Development
2 comments on “Unity 3D and Blender’s Curve Modifier, Hard Coding Tank Tracks
  1. Jasper says:

    I used the MegaFiers path deform modifier which I guess is the same as the Blender curve modifier except its in Unity.

2 Pings/Trackbacks for "Unity 3D and Blender’s Curve Modifier, Hard Coding Tank Tracks"
  1. […] first complication was that animations through Blender’s curve modifier won’t port into Unity 3D.  So to get around this I scripted the tank’s tracks instead of using an imported animation […]

  2. […] few days ago, I wrote a post about some of the problems I was having with getting my tank’s track animation within Unity for the Super Space Trooper video game I’m developing.  The problem was that when modeling […]

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>