Search Unity

Question Can't Move Up A Slope

Discussion in '2D' started by AdamEarlston, Nov 17, 2020.

  1. AdamEarlston

    AdamEarlston

    Joined:
    Jun 7, 2019
    Posts:
    71
    Edit: Came up with a work-around by making the slope a lot longer to get less of an angle, gonna have to reshape the bridge a little so i'm not floating above the bridge though. upload_2020-11-17_18-20-50.png

    Basically my character can't walk up slopes without coming to a stand still. (Using Rigidbody and Force) The issue is that i'm not applying enough force to climb up it, but if I apply any more force then my character moves too fast for the game.
    upload_2020-11-17_17-43-2.png
    That's the angle of the slope, very small..

    Does anyone know if there's a better way to climb the slopes? I don't know a single thing about coding or anything really, so i'm probably missing a simple rule or something.

    Additional Info:
    Only using 2.5f for walk speed, and 5f for running (Running makes it up, walk doesn't).
    Using 2 Box Colliders for the 2 different platforms, and an Edge Collider line to connect the 2 roughly. All of them have a NoFriction material applied.
    The player has a Rigidbody 2D and a Capsule Collider 2D
     
    Last edited: Nov 17, 2020
  2. AdamEarlston

    AdamEarlston

    Joined:
    Jun 7, 2019
    Posts:
    71
    Guess I fixed it by making the Edge Collider a lot longer to get a smaller angle. Gonna have to redesign the bridge slightly though.
    upload_2020-11-17_18-23-28.png