It was a typo!! The problem currently with objects resting on other objects is that it tries to set the x position to the center of the surface it wants to rest on instead of centering the x value on the center of the surface. This is how the original code seems to work, and I can't figure out why it works for them.