Restricting player movement via joints vs nested relative motion paths


I’m working on a kind of simple game, a kin to the old paper plane game Glider Pro. Here’s a flash version of Glider Pro for reference here.

Basically I have a glider-like object following a set MotionPath in my scene, and I want to constrain the object to only float up or down perpendicular to the motion path, but still have a controllable rate forward or back along the path as defined by a MotionEvent.

In other words, the only control the player has is whether or not to steer the object left or right on the screen, while still giving the glider the ability to react to ghost collision events like fans blowing beneath it to rise. I’m trying to keep it so the glider can’t go too far up or too far down to keep it on the screen.

I assume the best way to accomplish this is through a PhysicsJoint attached to an “airhook” node following the initial motion path, but I’m confused as to whether it could ever allow the glider object to pass through the node it’s attached to. It’s more akin to the notion of a “spring” than something which pivots around a fixed point.

My other thought was I could attach a vertical motion path to the airhook node, and allow the glider to rise or fall along the moving track. However it would appear that I can only define the motion path by Vector3f’s rather than by child nodes of the airhook. I guess I could reset the vertical motion path each frame based on looking up the location of the limiter nodes?

I’m sure there’s something obvious I’m missing, but would love to hear what approaches people think is most efficient.


I would simply code it myself,

eg use motionpath + offsetY inside a controll and manipulate offsetY as necessary.

Thanks for that! Creating a custom controller seems to do the trick.