Microelectromechanical and/or nanoelectromechanical device comprising at least two assemblies, one assembly called the first assembly and one assembly called the second assembly, each first and second assembly comprising at least one first part (2, 102) and at least one second part (4, 104) free to move relative to each other at least in an out-of-plane direction (Z), the first part (2, 102) comprising a first support and at least first electrodes (8, 108, 108′) extending parallel to the direction of displacement (Z), the second part (4, 104) comprising a second support and at least second electrodes (20, 120, 120′) extending parallel to said out-of-plane displacement direction (Z), the first electrodes (8, 108, 108′) and the second electrodes (20, 120, 120′) being arranged relative to each other such that they are interdigitated, the second support comprising at least one face perpendicular to the out-of-plane displacement direction (Z), the first electrodes (8, 108, 108′) comprising a first end and a second end in the direction of displacement, the second electrodes (20, 120, 120′) comprising a first end and a second end in the direction of displacement, in which the second ends of the second electrodes (20, 120, 120′) are directly connected to the face of the second support and their first end is located between the two ends of the first electrodes (8, 108, 108′) such that only part of the face of each second electrode (20, 120, 120′) is facing a first electrode (8, 108, 108′) at rest, and in which the first part of the first assembly is mechanically connected to the second part of the second assembly and the second part of the first assembly is mechanically connected to the first part of the second assembly.