Search Unity

Question The character flies with the Character controller component

Discussion in 'Physics' started by EDoS164, Feb 26, 2023.

  1. EDoS164

    EDoS164

    Joined:
    May 19, 2021
    Posts:
    3
    With the rigidbody component, my character went through colliders and the camera constantly lived its own life, although everything is ok with the script. Then I learned about the character controller component and applied it to the character. Fixed a bug with colliders and camera, but the character ignores gravity. What do you advise?
     
  2. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    989
    There are two functions for moving CharacterControllers. Move and SimpleMove. The second one will automatically apply gravity. However, in my experience if you are using the CharacterController component it is probably because you need very fine tuned controller over your object. So in that case I'd suggest simply using Move() and handle applying gravity yourself via script.
     
  3. EDoS164

    EDoS164

    Joined:
    May 19, 2021
    Posts:
    3


    https://ibb.co/DWST720

    I don't see this functions
     
  4. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    989
    They are functions not data. You will not see them in the inspector but rather in code. Check the links I provided for examples of how to use them.