Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

vehicle -character controller- collider issue

Discussion in 'Editor & General Support' started by C0DER, May 22, 2014.

  1. C0DER

    C0DER

    Joined:
    May 22, 2014
    Posts:
    2
    hi guys.
    I'm just developing a tank game. I just wanted to test character controller on the tank model... so the problem is that I can't make a good collider for the tank. It seems that the engine just sees the character controller collider and even if I creat a box or a mesh collider just the character controller collider is working.
    I tried to zero the radius and height of the collider but still the collider is the vertex of character controller middle of the tank and it goes into the wall..
    so what should I do now?:confused: thanks for ur help! :eek:
     

    Attached Files:

    Last edited: May 22, 2014
  2. TheGoozah

    TheGoozah

    Joined:
    Oct 16, 2012
    Posts:
    8
    I wouldn't use a CharacterController for a tank. It just has to many options you won't need and it indeed give some issues regarding the shape of it.
    The best approach here I think is to use different Box Colliders. Where one is the main body and is responsible for moving (don't forget to use the Translate method and not setting the position yourself), and the other boxes are linked to that parent. That way you can construct a "physx" mesh that represents the tank, and makes you able to detect where the tank could be hit, etc.
    Hope this helps.
     
  3. C0DER

    C0DER

    Joined:
    May 22, 2014
    Posts:
    2
    thanks dude.but I'm really new to unity and I'll be grateful if u explain this method a bit more :rolleyes: If it's needed i could give u the tank .FBX file !
    by the way how am I going to move it? I have the scripts from my team ...
     
    Last edited: May 22, 2014
  4. TheGoozah

    TheGoozah

    Joined:
    Oct 16, 2012
    Posts:
    8
    Hey, sure. I'll try to create a small scene and script example tonight. Just to give you a start.
    About the movement... You'll have to take a look how your teammates handle the movement, but most of the time the calculation should be the same.
    Cheers
     
  5. TheGoozah

    TheGoozah

    Joined:
    Oct 16, 2012
    Posts:
    8
    Hey, sorry I wasn't able to produce a small test scene 'cause of some extra deadline at work. I'll wont be able to make one this week as well.
    If needed, I could make one next week. Is that to late or did you already figured out how to implement the tank behavior in your project?