A method for performing a teat-related operation on a dairy animal (3) in an animal-positioning area (2) using a robot device (1). The robot device has a robot arm (14) with a camera (20) and a teat-treating device (25). The method comprises providing the robot arm outside the animal-positioning area, at least once performing determining an image of the environment by means of the camera, searching for a leg (5, 6) in the image, if no leg has been recognised in the image: displacing the robot arm in longitudinal direction outside the animal-positioning area until a leg has been recognised in the image, determining the longitudinal position of the leg with respect to the camera, displacing the robot arm in the direction of a predetermined positionary range with respect to the determined leg as long as the determined position is not in the predetermined positionary range, displacing the end part of the robot arm at right angles to the longitudinal direction from outside the animal-positioning area as far as under the dairy animal, and performing the teat-related operation. Furthermore, a robot device with a robot arm, a teat-treating device and a camera for performing the method is provided.