Both empirical and theoretical studies show that an individual's spatial position within a group can impact the risk of being targeted by predators. Spatial positions can be quantified in numerous ways, but there are no direct comparisons of different spatial measures in predicting the risk of being targeted by real predators. Here, we assess these spatial measures in groups of stationary and moving virtual prey being attacked by three-spined sticklebacks (
Gasterosteus aculeatus
). In stationary groups, the limited domain of danger best predicted the likelihood of attack. In moving groups, the number of near neighbours was the best predictor but only over a limited range of distances within which other prey were counted. Otherwise, measures of proximity to the group's edge outperformed measures of local crowding in moving groups. There was no evidence that predators preferentially attacked the front or back of the moving groups. Domains of danger without any limit, as originally used in the selfish herd model, were also a poor predictor of risk. These findings reveal that the collective properties of prey can influence how spatial position affects predation risk, via effects on predators' targeting. Selection may therefore act differently on prey positioning behaviour depending on group movement.