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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Gravity doesn't apply to particular rigidbody

Discussion in 'Editor & General Support' started by AngusWP, Apr 2, 2020.

  1. AngusWP

    AngusWP

    Joined:
    Mar 16, 2020
    Posts:
    11
    In Unity, gravity applies to all other objects except the player. My gravity is on and isKinematic is false, but the player doesn't fall at all.

    The only script attached to the player manages health, and has no mention of any movement in there at all.
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Can you show the inspector for the player, including the rigidbody?
     
  3. AngusWP

    AngusWP

    Joined:
    Mar 16, 2020
    Posts:
    11
    https://prnt.sc/rrxfga

    There you go
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Oh, thought you said there was only a health script. The character controller is the issue. Haven't used these in a little while, but if I remember correctly you need to call its SimpleMove method every frame for gravity to automatically be applied for you, or you manually apply gravity yourself with Move every frame

    https://docs.unity3d.com/ScriptReference/CharacterController.SimpleMove.html
    https://docs.unity3d.com/ScriptReference/CharacterController.Move.html
     
  5. AngusWP

    AngusWP

    Joined:
    Mar 16, 2020
    Posts:
    11
    Thanks so much!