- Home /
PutOnPath iTween spline but not restrict in the up direction (jump)
Hi, I'm using itween's PutOnPath for a 2.5D sidescroller but I was wondering if there was a way to constrain the the path only with the X/Z to be able to make the character "Jump"?
Thanks
Answer by pixelplacement · Oct 07, 2010 at 01:43 PM
Your best bet would be to encapsulate your character in an empty GameObject and place this "holder" on the path. That way you are free to cause your character to change his y axis while the cage around him leads him down the path.
I'd love to see what your come up with!
I'm using the 2D platfor$$anonymous$$g example as my base, and when I try to do the thing you said above, the player gets stuck to the path and many other things go wrong. Is there a way I can use the path and the 2d platfor$$anonymous$$g script?
This would take a little custom work as they are not intended to work in tandem. You would basically want to start by using the arrow keys to increases a percentage along the PutOnPath() once you have that working you would implement a "jump" action on the contained object that is being moved by the PutOnPath. Sorry if this is vague but you've asked a pretty hefty question that is going to require ground work on your end to build up to this desired effect. I'll think about putting this into an example for the support site.
Answer by pixelplacement · Oct 17, 2010 at 05:09 AM
Just put an example together on the support site for iTween that I hope helps out with this. Hope it helps: http://itween.pixelplacement.com/examples.php
Answer by araz01 · Sep 12, 2018 at 06:11 AM
I HAVE THE ANSWER! Create an empty Object on the path of iTween and create a character that follows this object. improve it by adding the furthest and closes the distance, being 4 and 0 maybe or something and make it slowly catch up to the obj that moving. you character will still be able to jump it just follows the obj and looks EXTREMELY smooth and good, i have not tried this but this is what i am looking for, Thank the Heavenly Trinity that I was gifted this truth to see! finally, i can do what i have been trying to do in the past 4 minutes.