Search Unity

Lock axis (changable)

Discussion in 'Scripting' started by MrReclusive, Jan 25, 2015.

  1. MrReclusive

    MrReclusive

    Joined:
    Nov 16, 2014
    Posts:
    14
    I am working on a 2.5D/3D sidescroller.
    I need to lock and unlock the axis of a player based various triggers around the level.
    when the level starts i need the X position locked, but in my game the player will make "turns" that will make it move along the x position so when that happens I need Z position locked and then back again.

    didn't realize this was an issue till i had some one else play it and they hit the "turn" to fast and the momentum of the X movement allowed him to fall off the platform when it switched to Z movement.
     
  2. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,697
    Diagrams would help.