Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Player stops moving mid-air

Discussion in 'Open Projects' started by NicknEmart, Nov 10, 2020.

  1. NicknEmart

    NicknEmart

    Joined:
    Sep 9, 2019
    Posts:
    46
    I am sorry to interrupt Unity's plan but I feel the strong need to do this.
    As @ciro said in the latest stream, when the player releases the moving buttons during a jump, our pig character stops moving and falls straight down.
    Now, while Ciro explicitly said that it doesn't look good (specifically because there's no inertia) and he almost treated it like a bug, I want to hear the community's opinion about it.
    Because - and if you've played a videogame before you should have noticed it - most of the times it isn't a bug, but a feature. The original Donkey Kong had the character forcedly continue to move until the jump finished, and there is a reason why the big N changed that in their future games.

    https://forms.gle/pA7ZNHSdQvu1GpPj9

    Of course, I don't have anything about Ciro - he may have had his reasons to say what he said - but please let me know YOUR opinions as well. Game feel and movement mechanics are important, and we should at least discuss a bit before we change anything
     
  2. cirocontinisio

    cirocontinisio

    Unity Technologies

    Joined:
    Jun 20, 2016
    Posts:
    884
    Haha, don't worry! :D It made me laugh.

    OK, let's see. But in any case, I am not too sure of which game stops the horizontal movement immediately as you release the input. I bet 99% of them have different degrees of inertia.
     
  3. NicknEmart

    NicknEmart

    Joined:
    Sep 9, 2019
    Posts:
    46
    Phew... :oops:

    Well, maybe I have been too quick to critique your comment. Most of the games that wander around in my mind are 2d games, in which I am pretty sure the character stops almost immediately whether on the ground or not.
    3d games are different though, and I haven't played many of them in recent times, so I can't make you examples; and if you say most of them have inertia, I believe you.
    I still think we shouldn't make use of inertia because that's the way games/reality works, but we should test it out and see how it feels better. Not all jumps are created equal, and different properties of the jump - length, height, floatiness - could make for different degrees of inertia.
     
  4. cirocontinisio

    cirocontinisio

    Unity Technologies

    Joined:
    Jun 20, 2016
    Posts:
    884
    I might be wrong, but I think no games nowadays interrupts the movement instantly as soon as the input is released. There's always at least A BIT of inertia. To various degree of course.

    This is what I mean by the way:

    Jump.jpg
     
  5. mattinjersey

    mattinjersey

    Joined:
    Dec 3, 2016
    Posts:
    42
    It’s not using unity physics or rigid body? I think the rigid body would automatically behave properly?

     
  6. cirocontinisio

    cirocontinisio

    Unity Technologies

    Joined:
    Jun 20, 2016
    Posts:
    884
    No we're not using physics on the main character, and we won't be (it would make things very funky). We're using the CharacterController.
     
  7. NicknEmart

    NicknEmart

    Joined:
    Sep 9, 2019
    Posts:
    46
    @cirocontinisio ok, now I get what you mean; that should feel about right :)
     
  8. erizzoalbuquerque

    erizzoalbuquerque

    Joined:
    Jan 23, 2015
    Posts:
    50
    I couldn't reproduce this behavior in the game nor could I found an issue on the repository. What branch are you using? I want to fix this bug as a way to start working on the character controller.
     
  9. cirocontinisio

    cirocontinisio

    Unity Technologies

    Joined:
    Jun 20, 2016
    Posts:
    884
    So, there was #48 which was a while ago, but the Character Controller has changed a lot since then.

    Then there's #58, but I think again it's a product of how the CC works: there's no physics, and the edge on which the character is "stuck" is horizontal, so for the CC we coded that is effectively a walking surface.

    I think a good fix is to tailor the CC's collision a bit better, which we did already. So I wouldn't worry too much for now, let's create more final scene geometry and then we'll see!
     
  10. deivsky

    deivsky

    Joined:
    Nov 3, 2019
    Posts:
    87
    Reviving this thread because I've made a PR that changes the way movement in the air is handled, effectively making the player not suddenly stop mid-air. It's actually a PR to another PR I made. Besides mid-air movement, it also contains changes to the sliding mechanic. Both PRs could use some testing and reviews so please check them out!