Problem with character controller and collider

Hi guys, newbie here.

I have a tank object, it has:
character controller
and mesh collider

My problem: the tank use the character controller’s collider to detect collision with other objects (like a wall etc) instead of the tank’s own mesh collider

So, at the moment, my tank will appear to go through wall until the controller little capsule collider hit the wall.

My question: is there any way for me to set up so that unity uses the mesh collider to detect the collision?

Also: right now my controller collider is a little sphere inside the mesh collider of the tank; I tried to enlarge it, thinking to better fit the shape of the tank so that the problem aforementioned can be solved, however when the controller become too large, the tank cant move (can only rotate) and it floats mid air.

thanks in advance for the help.

Hi,
Your tank fbx model must be containing some children inside it like some parts of it , some bones etc.You might be applying the mesh collider directly on the tank model , it will not work. Apply the mesh collider on the each sub part of the tank… then it will surely behave as u wanting

this is a school group project, another group member handled the modeling in maya and export it into fbx. I just drag the fbx into project asset and tick the “generate collider” on.

Is this okay?

Instead of doing so apply colliders manually and one more thing you should use less number of mesh collider.

take my tank_body.fbx for example
when i drag it into the scene, it has:
tank_body
-cannon point
-fuel tank
i apply mesh collider to both cannon point and fuel tank, then i apply mesh collider to the tank body itself
and lastly apply the movement script and controller to the tank_body

am I doing it right?

Unfortunately, you can’t change the default capsule collider used by the character controller. You will need to control the tank with rigidbody physics to make its collider contact with other objects realistically. However, if you increase the radius of the capsule then you might be able to make the collider a bit closer to the shape of the tank.