Search Unity

Character moves slower downhill than uphill

Discussion in '2D' started by Yokali, Feb 8, 2016.

  1. Yokali

    Yokali

    Joined:
    Feb 8, 2016
    Posts:
    3
    Okey, so my game is a 2d platform game and I want my character to be able to slide uphill and downhill when being fast (think like Sonic).
    The problem is that it moves slower downhill than uphill. My theory is that it has to do with collision detection, that it moves slower downhill because it is not always "touching" ground as it does when running uphill.

    How should I do this movement in a smoother way?
     
  2. James-Sullivan

    James-Sullivan

    Joined:
    Jun 15, 2015
    Posts:
    128
    It would help if we knew more about the problem. I assume that you artificially speed up the object when its going up or down a hill base on it being in contact with the surface?
     
  3. Yokali

    Yokali

    Joined:
    Feb 8, 2016
    Posts:
    3
    Imagine that there is a bowl that the character can jump into. The character will slide back and forth in the bowl due to gravity and the low friction. But when I want to run the character has it slowest pace in the bottom when running downhill and the highest when at the top of the bowl, it should be the other way around.
     

    Attached Files:

  4. Yokali

    Yokali

    Joined:
    Feb 8, 2016
    Posts:
    3
    Is there no one who have any idea on how to solve this?