In the basic public goods game the Nash equilibrium is to defect, that is, to share nothing. Resource sharing can evolve via multilevel selection on groups that have low variation within the group but have high variation between groups. In our simulation agents forage at random, can choose to share resources with others in their group as part of a public goods game, and if they have enough resources they can reproduce. We show that when there is a single group or large overlapping groups that individual selection leads to a population of defectors. We also show that when there is a number of isolated groups that multilevel selection leads to a population of sharers. In our simulation, agents compete indirectly for space in the population and we find that higher share percentages correlate with larger population sizes. Finally we also find that as the benefit for sharing decreases our agents share more with one another to achieve the same benefits.