Unity初心者です。風来のシレンを真似たゲームを作ろうと思っているのですが、斜めアニメーションが作動しないです。右を長押ししてる途中に下を押すと、右方向アニメーションのまま右下に移動します。 右を長押ししている途中でも、右と下を同時に押している時は斜めアニメーションに切り替わって欲しいです。原因と対処方法わかる方いましたら教えて頂きたいです。 if (animationflag == false) { if (Input.GetKey(KeyCode.DownArrow)) { animator.SetInteger("direction", 1);//下を向く } else if (Input.GetKey(KeyCode.DownArrow) && Input.GetKey(KeyCode.RightArrow)) { animator.SetInteger("direction", 2);//右下を向く } else if (Input.GetKey(KeyCode.RightArrow)) { animator.SetInteger("direction", 3);//右を向く } else if (Input.GetKey(KeyCode.RightArrow) && Input.GetKey(KeyCode.UpArrow)) { animator.SetInteger("direction", 4);//右上を向く } else if (Input.GetKey(KeyCode.UpArrow)) { animator.SetInteger("direction", 5);//上を向く } else if (Input.GetKey(KeyCode.UpArrow) && Input.GetKey(KeyCode.LeftArrow)) { animator.SetInteger("direction", 6);//左上を向く } else if (Input.GetKey(KeyCode.LeftArrow)) { animator.SetInteger("direction", 7);//左を向く } else if (Input.GetKey(KeyCode.LeftArrow) && Input.GetKey(KeyCode.DownArrow)) { animator.SetInteger("direction", 8);//左下を向く } }
C言語関連