[過去ログ]
【ゲームエンジン】Unityなんでも質問スレpart8 (1002レス)
【ゲームエンジン】Unityなんでも質問スレpart8 http://mevius.5ch.net/test/read.cgi/gamedev/1663487800/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
必死チェッカー(本家)
(べ)
自ID
レス栞
あぼーん
このスレッドは過去ログ倉庫に格納されています。
次スレ検索
歴削→次スレ
栞削→次スレ
過去ログメニュー
462: 弟子 [] 2022/10/27(木) 11:39:10.68 ID:gXi2+Oha 久しぶりだな まずさシンプルにいこう、逆に考えてみるか 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); } https://i.gyazo.com/e36cc76a809b1d8bfab8303cd513ff04.png これでスペース押すと、ジャンプ繰り返すんだけど 3回目で押せなくすればいいかなと http://mevius.5ch.net/test/read.cgi/gamedev/1663487800/462
464: 名前は開発中のものです。 [] 2022/10/27(木) 11:49:17.46 ID:gXi2+Oha >>462 ちなみに、jumpingFunctionはコメントにしてある。 でこのあとは、3回目という判定と、床に着いたらクリアをつくればいいかと http://mevius.5ch.net/test/read.cgi/gamedev/1663487800/464
465: 弟子 [] 2022/10/27(木) 11:57:08.00 ID:gXi2+Oha まぁこんなんで悩むのは時間の無駄だから答え moveFunction(); if (Input.GetKeyDown(KeyCode.Space)) { if (jumpCount > 2) return; rb.AddForce(rb.transform.up * 5.0f ,ForceMode2D.Impulse); jumpCount++; //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); } private void OnCollisionEnter2D(Collision2D collision) { jumpCount = 0; } http://mevius.5ch.net/test/read.cgi/gamedev/1663487800/465
476: 名前は開発中のものです。 [sage] 2022/10/27(木) 19:38:02.47 ID:gXi2+Oha ナゼ質問に質問で返すかなぁ 初心者イジメ好きなの? http://mevius.5ch.net/test/read.cgi/gamedev/1663487800/476
488: 名前は開発中のものです。 [sage] 2022/10/27(木) 22:16:15.43 ID:gXi2+Oha そういう場所だよ http://mevius.5ch.net/test/read.cgi/gamedev/1663487800/488
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.040s