From the Super Mario Wiki
Retrieved from "https://www.mariowiki.com/index.php?title=Compressor&oldid=2778323"
The Compressor, also known as a weight, is a piston-like machine in the Wario Land series. When Wario walks under one, the Compressor squishes Wario and transforms him into Flat Wario, allowing him to crawl into small spaces. Despite its effects, they do not harm Wario or any enemy in any sort of way. These objects mainly appear in factory levels (such as The Curious Factory) and some Puzzle Rooms. There is always a Decompressor or a body of water that returns Wario to his normal size and shape.
Compressors also appear in Yoshi's Story in the level Mecha Castle. They appear in pairs and try to crush an unsuspecting Yoshi passing between. If a Yoshi is crushed, it will be defeated instantly and lost as a result. Even the Super Happy Yoshi form cannot protect the Yoshi from this hazard.