Wonky Collision

Hello, so I have created a kind of 2.5D game. The character is a sprite, but everything else is 3D. How I have done this is by creating a GameObject, and I added a Rigidbody, the Movement Script, and a Capsule Collider. I created a GameObject inside the main one and put the Sprites and Animation.

All 3D objects have a Box Collider and that’s it. The problem is when I walk into an object, my character clips in and out of the object until I stop holding down the button. I have a feeling this might be a problem with my code, so here it is just in case.

public class PlayerLogic : MonoBehaviour {

	public float playerSpeed = 1.0f;

	void Start () {
		
	}
	

	void Update () {
		playerMoveMent ();
	}

	void playerMoveMent(){
		if (Input.GetKey (KeyCode.W)) {
			transform.Translate (0, 0, -playerSpeed);
		}

		if (Input.GetKey (KeyCode.A)) {
			transform.Translate (playerSpeed, 0, 0);
		}

		if (Input.GetKey (KeyCode.S)) {
			transform.Translate (0, 0, playerSpeed);
		}

		if (Input.GetKey (KeyCode.D)) {
			transform.Translate (-playerSpeed, 0, 0);

		}


	}

}

Thanks in advance.

@Jacob-Carey
Assuming that your colliders are ALL 3D (or ALL 2D) then the issue is that you are using transform.Translate. I am not going to tell you how to fix it because many other people have already answered this question. The first link is best for you because it is C# but the others still apply.