DaniDevy / FPS_Movement_Rigidbody

A physics based movement system
MIT License
492 stars 642 forks source link

I can't look around or crouch #40

Open jayman2009 opened 3 years ago

jayman2009 commented 3 years ago

please help me

jayman2009 commented 3 years ago

the jump and walking is fine but looking around or crouching does not work

kevlika commented 1 year ago

you just need to fix this issue you need this code on crouch on 80th line

crouching = Input.GetKey(KeyCode.LeftControl);

    //Crouching
    if (Input.GetKeyDown(KeyCode.LeftControl))
        StartCrouch();
    if (Input.GetKeyUp(KeyCode.LeftControl))
        StopCrouch();

instead of

crouching = Input.GetButton("Crouch");

    //Crouching
    if (Input.GetButtonDown("Crouch"))
        StartCrouch();
    if (Input.GetButtonUp("Crouch"))
        StopCrouch();