2D + 3D platfom game - stuck

The game play is simple…

generic 2D platfrom view is there at the beginning. Player can jump etc.

The twist here is that, the player can take turns when he reaches a corner. (90 degree turns)

So, if I press right arrow and left arrow to move right and left, I can use up arrow to move INTO the world (towards z axis, the level design will prompt the player to move so) and down arrow to move towards the player!

The difficulty is,
I need to have access to up and down arrow at a turn ONLY. I should not be able to use up and down arrow any place else. The same applies for right arrow and left arrow. I should be able to use them to take a turn and then continue the game. Also. how do I make the camera follow the player during the ‘up and down arrow’ phase.

I am sorry if the question was unclear!

And I understand that all of you have time constraints! So I don;t expect spoon feeding! Just point me in the right direction! :slight_smile:


I have posted an image to show you how I want it.

Imagine mario perspective and then suddenly he starts walking towards you and away from you!

Hope the image helps!

The camera will NOT ROTATE, it will only follow…

First, did you already have managed the 2D part? If no, I suggest you to take a look at my answer in How to make a side scroller? - Questions & Answers - Unity Discussions

All that you need to do is to make a Trigger object that change a flag (horizontal/vertical) in your script controller that you need to create. When this flag is changed, change the axis that was frozen and the input that you receive to move. You probably will not have problems with camera, because it always follow the character using a Lerp() in the fixed y distance between the two.