22/10/27 11:39:10.68 gXi2+Oha.net
久しぶりだな
まずさシンプルにいこう、逆に考えてみるか
void Update()
{
moveFunction();
if (Input.GetKeyDown(KeyCode.Space))
{
rb.AddForce(rb.transform.up * 5.0f ,ForceMode2D.Impulse);
jumpingFunction();
//print(max_jump_count);
//print(isHitToGround());
}
}
private void moveFunction()
{
//操作方向
float x = Input.GetAxis("Horizontal");
float y = Input.GetAxis("Vertical");
//左右移動
rb.velocity = new Vector2(x * 10, rb.velocity.y);
}
URLリンク(i.gyazo.com)
これでスペース押すと、ジャンプ繰り返すんだけど
3回目で押せなくすればいいかなと