An assembly (2) comprising at least two elements (10, 24) in a movable arrangement relative to each other for performing a first function of the assembly (2) is furthermore equipped with an anti-biofouling system (30) for subjecting at least an area (11) of the assembly (2) to be at least partially exposed to water during at least a part of its lifetime to an anti-biofouling action as an additional function of the assembly (2), different from the first function of the assembly (2). The anti-biofouling system (30) comprises one or more light sources (32) for emitting anti-biofouling light, and the anti-biofouling system (30) is adapted to realize coverage of the area (11) with the anti-biofouling light on the basis of the movable arrangement of the at least two elements (10, 24) relative to each other for performing the first function of the assembly (2).