It’s easy to pick up on the movements that other people make—scratching your head, crossing your legs. But a new study published in Psychological Science, a journal of the Association for Psychological Science, finds that people only feel the urge to mimic each other when they have the same goal.

It’s common for people to pick up on each other’s movements. “This is the notion that when you’re having a conversation with somebody and you don’t care where your hands are, and the other person scratches their head, you scratch your head,” says Sasha Ondobaka of the Donders Institute for Brain, Cognition and Behaviour at Radboud University Nijmegen in the Netherlands. He cowrote the paper with Floris P. de Lange, Michael Wiemers, and Harold Bekkering of Radboud and Roger D. Newman-Norlund of the University of South Carolina. This kind of mimicry is well-established, but Ondobaka and his colleagues suspected that what people mimic depends on their goals.

“If you and I both want to drink coffee, it would be good for me to synchronize my movement with yours,” Ondobaka says. “But if you’re going for a walk and I need coffee, it wouldn’t make sense to be coupled on this movement level.”

Ondobaka and his colleagues devised an experiment to see how much of a pull people feel to mimic when they have the same or different goals from someone else. Each participant sat across from an experimenter. They played a sort of card game on a touch screen embedded in the table between. First, two cards appeared in front of the experimenter, who chose either the higher or the lower card. Then two cards appeared in front of the participant. This happened 16 times in a row. For some 16-game series, the participant was told to do the same as the experimenter—to choose the higher (or lower) card. For others, they were told to do the opposite. Participants were told to move as quickly and as accurately as possible.

When the participant was supposed to make the same choice as the experimenter, they moved faster when they were also reaching in the same direction as the experimenter. But when they were told to do the opposite of the experimenter—when they had different goals—they didn’t go any faster when making the same movement as the other person. This means having different goals got in the way of the urge to mimic, Ondobaka says.

The researchers think that people only copy each other’s movements when they’re trying to accomplish the same thing. The rest of the time, actions are more related to your internal goals. “We’re not walking around like chameleons copying everything,” Ondobaka says. If you’re on a busy street with dozens of people in view, you’re not copying everything everybody does—just the ones that have the same goal as you. “If a colleague or a friend is going with you, you will cross the street together.”