Players can't move through objects, but they can glitch through it.

Hello, players can’t walk through objects however they can glitch through it i suppose is the word when you continue to walk forward. I am unsure if this is a scripting issue or perhaps something with collides but I’ve been having this issue for a while and some help would be much appreciated. Also I am using Photon servers if that has anything to do with it. Thanks.

Here is my character controller script that I think may have something to do with it. I’m not too sure.

using UnityEngine;
using System.Collections;

public class characterController : MonoBehaviour
{

public float speed = 10.0F;

// Use this for initialization
void Start()
{
    Cursor.lockState = CursorLockMode.Locked;
}

// Update is called once per frame
void Update()
{

    float translation = Input.GetAxis("Vertical") * speed;
    float straffe = Input.GetAxis("Horizontal") * speed;
    translation *= Time.deltaTime;
    straffe *= Time.deltaTime;

    transform.Translate(straffe, 0, translation);

    if (Input.GetKeyDown("escape"))
        Cursor.lockState = CursorLockMode.None;

}

}

Try using Rigidbody.velocity to move your player.

public Rigidbody rb;
void Start()
{
    rb = GetComponent<Rigidbody>();
}
void FixedUpdate()
{
    rb.velocity = new Vector3(0, 10, 0);
}

Remember to use inside FixedUpdate() function.