Search Unity

CharacterController.Move documentation is incorrect

Discussion in 'Documentation' started by mnarimani, Aug 11, 2019.

  1. mnarimani

    mnarimani

    Joined:
    Mar 27, 2017
    Posts:
    186
    First, You need to use normalized input direction to avoid having diagonal movement advantage.
    Second, Gravity calculation is so f**ked up. I don't know who wrote that but it's straight bullshit. The doc tries to fix its incorrect gravity calculation with increasing gravity.
    Gravity * deltaTime * deltaTime gives you delta velocity which you need to add to current velocity of the object. You don't add that to movementMotion which is a movement delta.
     
  2. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    284
    Not sure why would you use explicit language, as it was clearly not needed, especially when your main claim simply can't be true. Acceleration is the second derivative of position - that means you need to integrate acceleration twice to get position (in discreet terms - multiply by delta t squared). Anthony. Read up here: https://en.wikipedia.org/wiki/Acceleration