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