Search Unity

Slopes kill speed

Discussion in 'Physics' started by glasshalfpool, Jun 21, 2017.

  1. glasshalfpool

    glasshalfpool

    Joined:
    Feb 20, 2017
    Posts:
    12
    Hi

    I have a simple racing game where the vehicle is propelled forward at a fixed speed by adding force to the transform.forward of the rigid body of the player object.

    All was fine on a flat surface, but upon introducing slopes the force applied cannot push the player up the hill.

    Is there a way I can apply the same speed to the player regardless of the incline? Do I need to calculate the incline and apply more force on the fly perhaps?

    Any advice appreciated.

    Thanks,
    Jamie
     
    BrandyStarbrite likes this.
  2. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    One good person to ask, is a Unity user, called Aaron Hibbard.
    And he makes games and he posts tuts, which are on Youtube too.
    https://www.hibbygames.com/unity-5-tutorials/
    Last I checked, he was working on a cool, Mario Kart style racing game. ;)

    Check out his Youtube channel and ask him, because he would most likely
    have an answer to that question, since his Kart racing game, has all sorts
    of krazy physics in it. :)
     
    Last edited: Jun 28, 2017