Search Unity

Ladder system

Discussion in 'Scripting' started by Baskyn, Dec 18, 2014.

  1. Baskyn

    Baskyn

    Joined:
    Feb 17, 2013
    Posts:
    67
    I was wondering what you could do for a ladder system like in zelda. I've seen basic ladder systems and understand how they work(like in halo where you just slide up the ladder). The kind I am talking about is where the character goes up/down each step/handle individually and it's not a smooth motion up the ladder.

    Like this(Skip to 4:04):


    I have ideas on how this could be done, but none of them seem very efficient.
    I would like to hear ideas on how you guys would do this.

    Thanks!
    Baskyn
     
    Last edited: Dec 18, 2014
  2. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    Disable standard controls entirely and enable a script / flip a boolean that allows ladder controls. Since ladders have variable sizes and there are all kinds, you could make a really basic script for the ladder. When the user "connects" to it, move in steps. You can define how far up or down a step takes you up a ladder, and in your ladder movement & controls, have a brief pause between each step.
     
    Baskyn likes this.
  3. Baskyn

    Baskyn

    Joined:
    Feb 17, 2013
    Posts:
    67
    That's how I thought about doing it. So, would you use a coroutine for the pause in between?
     
  4. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    I do all of the timing myself in my projects, but from what I've read people using coroutines for, it should work. Given how small the task is, it would be easy to implement either. I suggest finding which option suits your coding style better and would be more applicable for you in future projects at a larger scale.
     
    Baskyn likes this.