Regarding motion paths

What I have in mind is a 2D game in a 3D world, and, of course, the character moves in a straight line. however i wanted that in some parts of the game i could make smooth turns, just to give some “cool efect” :stuck_out_tongue:.

I tried to do this by using a motion path, however, i think it was designed more for camera motion than for other things. I can only move the character based on the mopath’s motion path (basically i cant jump, the character is “stuck” on the mopath), i believe that using a node for the motion path and for mopath interval, and a node child for the model which I may move the model up and down. Is this a right approach?

Also i dont know how to set the heading in the interval, so that the character turns in the direction of the mopath. Does the mopath have something to adjust that?

This could be pretty useful for creating flying planes or cycling paths for characters or something like it :wink:

Any help would be greatly appreciated :slight_smile:

Edwood

This is a perfectly reasonable approach. It should not be difficult to animate the parent node with the Mopath, and animate a child node up-and-down to implement a jump.

There are other ways to achieve a similar effect, for instance by using a keyframe animation generated in Maya, or by coding the whole animation using a Python function. But a Mopath is a fairly convenient way of doing it.

Try:


mopath.fFaceForward = 1

David

Yay!! it works very nice… thanks a lot david…

Now i was wondering how could I implement going backwards… maybe i can use another mopath that has an inverse trayectory? I could pause one mopath, and then play the other one…

Because I tried to find something to change the playrate of the mopath, and also i tried to change the fFaceForward command to -1 to see if there was a small possibility that that could reverse the orientation of the model, but with no succes… but im not sure if doing two mopaths is right, maybe the node will get confused and start doing strange things? :laughing:

Edwood

Two mopaths might be the simplest approach. You might be able to reverse a mopath by running a MopathInterval(fromT = mopath.getMaxT(), toT = 0), and you can reverse the faceForward direction by using an intervening node with setH(180).

David