@Override
                    public void onWayPointReach(MotionEvent control, int wayPointIndex) {
                        if (path.getNbWayPoints() == wayPointIndex + 1) {
                            wayPointsText.setText(control.getSpatial().getName() + " Finished!!! ");
                        } else {
                            wayPointsText.setText(control.getSpatial().getName() + " Reached way point " + wayPointIndex);
                        }
                        wayPointsText.setLocalTranslation(
                                (app.getCamera().getWidth() - wayPointsText.getLineWidth()) / 2,
                                app.getCamera().getHeight(),
                                0);
                    }
This test creates a scene with a teapot following a motion path.
jme3-screenshot-tests/src/test/java/org/jmonkeyengine/screenshottests/animation/TestMotionPath.java