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

AddForce in XZ reduces gravity ?

Discussion in 'Physics' started by frostyone, Sep 3, 2021.

  1. frostyone

    frostyone

    Joined:
    Aug 2, 2018
    Posts:
    8
    Trying to recreate this character controller and modify it a bit for my needs

    upload_2021-9-3_21-45-57.png
    Running into issue where AddForce XZ reduces gravity while active ?
    (tried with/without AddForce Y and just changing velocity directly , rigidbody.velocity)

    Seems strange , or am I missing something ?
     
  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,120
    Can you explain what you mean by "reduces gravity"? Do you mean that the character falls more slowly than usually when you're apply later force via AddForce? Or are you talking about some other kind of behavior?

    If you're using standard rigidbody gravity (rather than applying gravity yourself), and you're only calling AddForce with X or Z force components, that should have no effect on the vertical velocity of the object. Once you start manually modifying the ".velocity" of the rigidbody, though, there are lots of ways you could mess that up and conflict with normal gravity.
     
  3. frostyone

    frostyone

    Joined:
    Aug 2, 2018
    Posts:
    8
    I had AddForce working in Y and AddForce working in XZ (no ".velocity" modifications)
    Issue was with Mass and Scale I had , had to balance it and AddForce in Y for character to fall properly during XZ movement )
     
    Nedgoom likes this.