When dosimetric effects in time-dependent geometries are studied, usually either the results of individual three-dimensional (3D) calculations are combined or probability-based approaches are applied. These methods may become cumbersome and time-consuming if high time resolution is required or if the geometry is complex. Furthermore, it is difficult to study double-dynamic systems, e.g., to investigate the influence of time-dependent beam delivery (i.e., magnetically moving beam spots in proton beam scanning) on the dose deposition in a moving target. We recently introduced the technique of 4D Monte Carlo dose calculation to model continuously changing geometries. In intensity modulated proton therapy, dose is delivered by individual pristine Bragg curves. Dose spots are positioned in the patient by varying magnetic field and beam energy. If the movement of these dose spots occurs during significant respiratory motion, interplay effects can take place. Because of the inhomogeneity of individual subfields, the consequences of motion can be more severe than in conventional proton therapy. We demonstrate how the technique of 4D Monte Carlo can be used to study interplay effects in proton beam scanning. Time-dependent beam delivery to a changing patient geometry is simulated in a single 4D dose calculation. Interplay effects between respiratory motion and beam scanning speed are demonstrated.