Home Technical Talk

tank rig for video game

Elie
polycounter lvl 7
Offline / Send Message
Elie polycounter lvl 7
Hey all,
would you recommend a method for rigging a tank in Maya for games in Unity?
I found one but it needs too much joints for optimizing the treads...

Replies

  • .Wiki
    Offline / Send Message
    .Wiki polycounter lvl 8
    I did a simple tank rig for a unity application some years ago.

    You can animate animate the uvs of the tracks to create the illusion of movement. Thats how its done in a lot of games too.

    Then you just need to deform the tracks with the suspension of the wheels.
  • Elie
    Offline / Send Message
    Elie polycounter lvl 7
    thanks .Wiki but how do you animate uvs? I didn't know we can do that.
  • Mark Dygert
    Usually you set up the UV's to scroll across a tillable section of the texture, make the treads a separate material and then animate the UV offset in unity. You can tie into it, a number of ways. 


  • Elie
    Offline / Send Message
    Elie polycounter lvl 7
    thanks Mark, I'll take a look, do you think I need to animate everything in Unity? I thought I should rig it in Maya, to go properly in every direction, and turning etc
  • Mark Dygert
    Yea, I would rig it  up in Maya, but treat the treads as a separate mesh that gets parented to the main tank in unity so you can swap the tread model with different models for different states, broken treads, road tracks, mud caked ect...

    I personally would add some joints to the tracks so they wobble and wiggle in the slack areas but it's not necessary, just kind of a cool secondary motion touch that doesn't eat up that many joints and can be dynamic so it reacts to what the tank is doing. You can also set up the bottom of the treads to follow joints that move up and down as it slides over the terrain, making it look like the treads are reacting to whatever the tank is rolling over. but that will take a bit of setup in Unity.
  • .Wiki
    Offline / Send Message
    .Wiki polycounter lvl 8
    You can use:

    <div><div><div>renderer.material.SetTextureOffset("_MainTex", new Vector2(offset, 0<span>));</span></div></div></div><div></div>

    To animate your uvs.

    You can use a control object, like the wheel rotation angle to control the offset.

  • Elie
    Offline / Send Message
    Elie polycounter lvl 7
    thanks a lot, for now, we chose to experiment with a blendshape
Sign In or Register to comment.