Object shakes on collide!

void FixedUpdate() {
if (Input.GetKey(KeyCode.A))
transform.position -= cameraTransform.right * (Time.deltaTime * speed);

		if (Input.GetKey(KeyCode.W))
			transform.position += cameraTransform.forward * (Time.deltaTime * speed);

		if (Input.GetKey(KeyCode.S))
			transform.position -= cameraTransform.forward * (Time.deltaTime * speed);

		if (Input.GetKey(KeyCode.D))
			transform.position += cameraTransform.right * (Time.deltaTime * speed);

Hello, this is my player movement code. Problem is whenever I collide with something (I am using box collider), my object (player) shakes and sometimes falls off (not through floor).

I searched for it and somebody had the exactly same problem. Answer said use FixedUpdate() and don’t use transform.Translate… I wasn’t doing any of that.

Sorry for my English if I did any mistakes, thanks for any answer.

Edit: I have a not permanent solution: In rigidbody increase the mass.

I only know the problem which is I think you are using rigidbody and collider both with your object which generally makes objects to shake when you are using code like:

transform.position -= cameraTransform.forward * (Time.deltaTime * speed);

Solution of your question is you need to change the way of moving your player(don’t use transform.translate either). Because this way of moving forces the object to move from one place to another.

Please tell me when you get solution.

Sorry for improper answer.

Thanks in Advance