Is there a way to transform location for only the z-axis?

So for some context of what is going on, here is an image of the default character class with a mesh just added in, as you can see the character at (0,0,0) is standing in the middle of the capsule collider which is used for collision detection.

Next I have moved the character down by the capsule half height so the feet align with the bottom of the capsule collide, but note that in it’s relative space the center of the capsule collider is still at (0,0,0)

When you scale it is around the (0,0,0) relative space coordinate so that is why the ground suddenly dissapears out from under your character.

To do a line trace You can do the following, though I chose 100 units above and below arbitrarily just knowing it is larger than the capsule half height, you may need to adjust as you see fit:

Hope this helps.