Ambush site selection by sit-and-wait predators is a complex process, involving biotic and abiotic considerations, which greatly affect hunting success and costs. Wormlions are fly larvae that dig pit-traps in loose soil and hunt the arthropod prey falling into their pits. They are abundant in urban environments, found below buildings that provide cover, and many of their pits are dug adjacent to walls. We examined here under what conditions wormlions prefer to dig their pits next to walls. We analysed our dataset in two ways: frequency comparisons among the different treatment combinations and a simulation null model assuming random movement. While the frequency comparisons suggested that wormlions avoided the walls under some cases, the simulation null model suggested that a combination of shallow sand and strong light in the centre led to an attraction towards the walls, independent of the wormlions' initial location. We suggest that wall attraction results from the certain amount of shade the walls provide. We also demonstrate that shallow sand and strong illumination are unfavourable microhabitats, either leading to more frequent movement or the digging of smaller pits. We locate our results within the broader context of sit-and-wait predators and of animals' attraction to barriers. In contrast to widely-foraging predators, sit-and-wait predators do not search for prey. Rather, they choose an ambush location and wait for the prey to enter their detection range before attacking it 1,2. This foraging mode allows sit-and-wait predators to save the energetic costs of searching and to survive long periods of shortage of prey by reducing their metabolic rate 3-5. Ambushing prey instead of searching can also lower the risk of predation on the sit-and-wait predator, due to the positive association between searching intensity and predation risk 6-8. This foraging mode's drawback, however, lies in the low encounter rate with prey, forcing such predators to be opportunistic foragers 1,9. Sit-and-wait predators must choose their ambush sites carefully. Because sit-and-wait predators count on the prey to reach them, they often select ambush sites rich in prey in order to maximize capture success 10-12. Sit-and-wait predators are therefore attracted to abiotic cues, which are either correlated with prey abundance or facilitate prey capture 13-16. However, in many other sit-and-wait predators, considerations related to minimizing ambush costs dominate over those related to high prey abundance. For example, sit-and-wait predators select sites that limit exposure to extreme thermal conditions 17-20. Trap-building predators (hereafter, TBPs) are a subgroup of sit-and-wait predators, which construct traps to facilitate the capture of prey 21,22. The most common trap-building predator groups are the web-building spiders and pit-building antlions or wormlions, presenting case studies of convergent evolution 21,23. The selection of suitable sites for trap construction and ambush for prey is even more important for this group of p...