How to change the capsule's height without deforming it?

I’m trying to create a primitive capsule gameobject, that changes height and radius when I type in corresponding numbers. However, changing the “localScale” variable will deform it, makes it looking non-capsule-like.

I want to change the height and radius in a way you do it in the CapsuleCollider. However, capsule collider doesn’t appear on the gaming view. Is there a way to make the collider show(not only the lines, but filled with color)? Or is there a way to change the height of the capsule without deforming it?

Sorry for my poor English. I would really appreciate your help.

Never mind, I have created the shape I wanted by combining one cube and two spheres.

Still thanks for those who have tried to look for the answer.

BTW, the answer is NO. There’s no way to make just part of a model stretch (long sides, but not rounded ends.)

The full version of your solution is hand-making a middle part, and a rounded “cap” part. Either way, the trick is that the part you want to stretch is one separate model.

You get the same problem trying to grow a ring. There’s no way to scale it twice as big without also scaling it twice as thick. Everything scales together.