Hi,
I’m creating a game which uses a ball that’s being shot at a target.
After a shot the ball should go back to the startingposition and must be ready to shoot again.
I use this code to reset the ball:
ballBody.activationState = AWPCollisionObject.WANTS_DEACTIVATION;
ballBody.position = startPosition;
This doesn’t work as I had hoped. it works most of the time, but sometimes the ball gets moved back to the startposition, but then the ball continues to bounce in exactly the same direction as it was going before the transfer to the startposition.
My guess is that the movementspeed and direction somehow isn’t removed and continue to apply to the ball when reset to the startposition.
I thought my code above was a way to deactivate all forces, but appearently not.
So is there a way to completely remove all forces that are being applied to the ball?