platform mesh and collider are not working together

I’ve added this script to my game which rotates the Platform;

CurrentPlatform.transform.Rotate (Vector3.right, RotationSpeed * Time.deltaTime);

But this code rotates the box collider like I want but the mesh of the object is not rotating, the mesh ends just slants one way. Does anyone know how to edit this line of code so the mesh and the box collider stays aligned so the platform rotates with the collider?

how is the gameobject you are trying to rotate structured in the hierarchy?

The object I’m trying to rotate is a child of an empty game which I have this script applied to. The object has a transform, cube mesh filter, mesh renderer and a mesh collider.