- Home /
Player walk in a certain path
I want to make a movement that player can walks only some specific places, some thing like this: First the movement of the player is normal(he moves depending the camera rotation something like Splinter Cells games) and I want that when the player enters to a points that are making a cube the player can only walk in that certain path.
Another example of this application: suppose that I have a wall and the player climbs the wall or tube like here at 2:48, as you can see the player can only move on a certain path, but remember that my movement depends on the camera so please don't put a question saying that block forward and backward movement, so my question is how can I do this?
Note: JavaScript please
Answer by Chris D · Apr 25, 2011 at 05:09 PM
Though i haven't tried it myself, from what I understand, this is the kind of thing iTween excels at. Check out the MoveTo function here:
http://itween.pixelplacement.com/documentation.php#MoveTo
If you set your character to enter into a set animation once it hits some sort of trigger, it seems to me this solution could work.
EDIT:
looking a little deeper, it seems there's even a graphical path editor: http://pixelplacement.com/2010/12/03/visual-editor-for-itween-motion-paths/
but this brings me a problem, I already know about iTween, but the problem is the camera, because I can simply set that move right and left, but not, using a movement based on camera is different, so please who I can do this with my movement
Are you saying that your camera can currently only move left and right? If, like in the video, you're using a third-person view that gives the camera lots of freedom of movement, I'd suggest setting a similar kind of trigger for it as you would for your character. That's to say that when your player enters the trigger zone and begins his iTween movement, the camera will begin a similar movement path. Does that make sense?