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.