최근 질문글(질삭튀 x 인증용)


[미해결] 유니티 옵션 설정 조정 - 인디 게임 개발 갤러리 (dcinside.com)



특정 키를 누를때 다른 키의 입력을 막으려고 하는데 되는게 있고 안되는게 있어서 물어봄

주먹 발 코드


        if (f_currentTime <= 0)

        {

            if (Input.GetKeyDown(KeyCode.Z) && rigidbody2d.velocity.y == 0)

            {

                b_AttackP = true;

                b_Dash = false;

                //Collider2D[] collider2Ds = Physics2D.OverlapBoxAll(curPos.position, boxSize, 0);

                //foreach (Collider2D cols in collider2Ds)

                //{

                //    Debug.Log(cols.tag);

                //}

            }

            if(b_AttackP)

            {

                animator.SetTrigger("Player_punchT");

                animator.SetBool("Player_stay", false);

                animator.SetBool("Player_walk", false);

                //animator.SetBool("Player_Dash"), false); //추가하여 대시 방지하기

                //animator.SetBool("Player_death", false);

                f_currentTime = f_handcooltime;

                b_AttackP = false;

            }

            if (Input.GetKeyDown(KeyCode.X) && rigidbody2d.velocity.y == 0)

            {

                b_AttackK = true;

                b_Dash = false;

            }

            if(b_AttackK)

            {

                animator.SetTrigger("Player_kickT");

                animator.SetBool("Player_stay", false);

                animator.SetBool("Player_walk", false);

                //animator.SetBool("Player_Dash"), false); //추가하여 대시 방지하기

                //animator.SetBool("Player_death", false);

                f_currentTime = f_kickcooltime;

                b_AttackK = false;

            }


점프 코드

        if (Input.GetKeyDown(KeyCode.Space) && rigidbody2d.velocity.y == 0 && b_Hurt == false) //점프

        {

            animator.SetTrigger("Player_jumpT");

            rigidbody2d.AddForce(Vector2.up * JumpForce, ForceMode2D.Impulse);

            animator.SetBool("Player_walk", false);

            animator.SetBool("Player_stay", false);

        }


인데 주먹키를 누르면서 점프를 누르면 주먹질이 되면서 점프가 됨

발도 마찬가지고

혹시 이걸 막으려면 어떻게 처리하면 좋을까?