Search Unity

Make CharacterController jump with an arc.

Discussion in 'Physics' started by katsuragi545, Mar 27, 2018.

  1. katsuragi545

    katsuragi545

    Joined:
    Jun 25, 2014
    Posts:
    38
    I'm currently using the CharacterController for a platformer I'm working on. I don't find the default jump behavior of the CharacterController too favorable - mainly because it doesn't propel the character in an arc if the user stops pressing the directional buttons. I'm hoping to achieve a jump similar to 3D Super Mario games. Basically, when the player is running and they press the jump button, the character will jump in arc and continue in that arc even if the player lets go of the directional keys. I've done this before using a rigidbody but never with a CharacterController. Does anyone know how to achieve this?
     
  2. duisti

    duisti

    Joined:
    Nov 29, 2017
    Posts:
    52
    You could probably register the current velocity values when you're airborne, and apply that velocity on top of your input velocity (maybe implement a speed cap also, so you can't move faster by jumping, unless you want the classic bunnyhopping effect!)

    It'll take some editing of the script. But if you understand what the charactercontroller script does on each part, then it should be simple. Good luck.