Controlling gravity

There is my code first of all.

I am trying to have a box stop falling on the press of space. I do a setAffectedByGravity on the node when space is pressed but nothing happens, it continues to fall however the key is working. What could this be?

When you set affected by gravity to false, the box is not accelerating anymore, but the force is still there and dragging the box downwards.

There is no friction which would slow the box down.

When you set affectedBygravity to false, you also want to clear its current forces with waterNode.clearDynamics();

Also in your update method you update physics twice, it should look like this:

      public void update(float tpf) {
                //Update root node's location on items

The great thing is, I only need it to drop then have it hit a surface, thus making the applying Y positive force un-needed.