Search Unity

[Question] Player Crouch Help

Discussion in 'Getting Started' started by Black-Spirit, Dec 16, 2022.

  1. Black-Spirit

    Black-Spirit

    Joined:
    Sep 14, 2013
    Posts:
    67
    Hi, please move post to correct thread if needed.

    Making a basic multiplayer FPS co-op game, and trying to set up the player visuals.

    Basically its somewhat full body awareness, though the local player cant see their renderer, but the other players can.

    What I'm struggling with is the player crouching. I'm changing the character controller height and centre when crouching. This works, though causes the player model to go halfway thru the floor. The collider resizes and sits on Y 0 as it should so I never fall through the ground.

    How can I stop the model from moving down?
     
  2. AngryProgrammer

    AngryProgrammer

    Joined:
    Jun 4, 2019
    Posts:
    490
    Do not rely on your calculations and bypassing the rules of the game physics.

    Use appropriate tools built into Unity for this purpose, such as Animator. There you define the position of the character's skeleton (standing, crouching, running), what are the transitions between specific states of the character, etc.