My character controller falls through a box collider

I’m admittedly new to this… anyway my issue is that the object I use for my character uses a character controller and my ground objects use box colliders. I start my character object several meters above the ground by it falls through the box collider every time. I’ve made the gravity very small in an attempt to counteract this and made my box collider much bigger, neither helped.

using UnityEngine;
using System.Collections;

public class PlayerClass : MonoBehaviour
{
	private float hspeed = 10f;
	private float vspeed = 0F;
	private float gravity = 1F;
	private float test = 0;
	private Vector3 moveDirection = Vector3.zero;
	private float hdirection;
	public bool isaccending=true;
	private float movspeed=0;

	// Use this for initialization
	public float movementSpeed = 10;
    public float turningSpeed = 60;
	void Start(){
		
	
	}
    void Update() {
		CharacterController controller = GetComponent<CharacterController>();
        float horizontal = Input.GetAxis("Horizontal") * turningSpeed * Time.deltaTime;
        transform.Rotate(0, horizontal, 0);
        float vertical = Input.GetAxis("Vertical") * movementSpeed * Time.deltaTime;
        transform.Translate(-vertical, 0, 0);
		float strafe = Input.GetAxis("Strafe")* movementSpeed * Time.deltaTime;
		transform.Translate(0, 0, strafe);
		isaccending=controller.isGrounded;
		if(controller.isGrounded){
			vspeed =0;
			
		}else{
			vspeed-=gravity* Time.deltaTime;
		}
		transform.Translate(new Vector3(0,vspeed,0));
		
    }
	
}

Make Sure You Check Following things :
You have added Capsule Collider or Character controller to player
You added rigidbody to player
Script is not accessing any rigidbody or character controller component and changes it on Runtime
Mesh colider you have added to box is checked at top bar
Check these and come back
if Helped #meer #opkashmir

Transform.translate is purposely made to ignore collisions. It will move you through walls, etc… . Use controller.Move instead (lots of places here to find movement scripts using it.)

Turns out that checking for obstacles and figuring out the correct way to slide around any slanted walls you ram, that takes a lot more work than just moving. translate just moves, same as using the Inspector to move (translate is the actual math term for sliding something.) controller.move has all of that extra “is there a box below me?” checking built in.