During my quest for a solution, I came across a common practice where users used cannonBody.velocity.y = JUMP_VELOCITY to make an object jump.
However, in my scenario, this method only worked while the object was already in motion and not when it was stationary. This led me to wonder if there are specific conditions that need to be met for the object to jump successfully.
I am also interested in seeing a demo snippet that demonstrates how to make a simple object (such as a ball) jump when the spacebar is pressed.