Step on the switch to make a moving platform appear, along with some statues.
Shooting the different statues makes the platform move in different directions.
To get to the far door, you can hop onto the platform and shoot the middle statue, then the top statue, to make the platform carry you across. But that’s the hard way of doing it.
The easier way is to wait by the door until the platform has passed by you, then shoot the bottom statue so that the platform comes back towards you. You have time then to walk across it to the middle (blocked) door where you can catch your breath. A well-timed shot at the middle statue will send the platform towards the top door, and you can hop on to ride there with it.