Player Movement ice slide puzzle

Hi

So I’m making a 3D ice slide puzzle. That’s a simple game were you try to escpape the ‘maze’. The only problem I have is that I don’t know how to write the script for player movement.
158993-ice-cave.jpg
The game should work like this:

  • If I press the UpArrowKey the player cube (3D) will go forward and stops when it hits an obstacle.
  • When the player cube is moving, I may not be able to press other keys. This is to prevent diagonal movement.

I have already tried to write a script but I failed several times. So now I’m hoping someone could help me out.

Thank you

Not really a question and you ask too much from us (see the forum guidelines).

Try to make some code and edit this post with it.

If you just want ideas, there are dozens of ways to achieve this, here is one :
You could use the physics system and stop the player from controlling the character until it hits something using OnCollisionEnter or OnTriggerEnter.