Alternatives to transform.Rotate

I have this script attached to my game object. Basically its a bridge that the player moves with A and D. I have another object that is the ground and when I move the bridge, it goes right through the ground. I know it does this because I am using transform.Rotate but anything else that I have tried dosent work. I know this is a simple question but I cant figure it out. Both of the objects have colliders and rigidbodies.

#pragma strict

var speed = 30;

function Update () {
	
	if (Input.GetKey(KeyCode.A))
		transform.Rotate(0, 0, speed, Space.World);
		
	if (Input.GetKey(KeyCode.D))
		transform.Rotate(0, 0, -speed, Space.World);
}

If it contains rigidbody, you can use rigidbody.moverotation, or rigidbody.addtorque.

Also, your issue does not steam from using rotate. Everything functions as intended. If your bridge is using a mesh collider, it cannot collide with any other mesh colliders, unless they’re convex mesh colliders. Use box colliders with your bridge instead.

You can also use clamping, so that before moving:
Mathf.clamp(speed,minimumangle,maximumangle);