Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Kinematic character controller dips and can eventually fall through moving vertical platform

オープン
#488 コメント 1 件 リアクション 12 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
javascript, rust, wasm
領域
game-dev

調査の方向性

リンクされた例を使って問題を再現し、その後、src/plugins/KinematicCharacterController.ts の 263 行目付近と physics/physics.game.ts の 239 行目付近を読みます。JavaScript の挙動を Rust の character-controller 実装および kinematicPositionBased のプラットフォーム移動と比較します。コントローラーが上下に移動するプラットフォーム上に留まり、跳ねたり、沈み込んだり、すり抜けて落下したりしなければ完了です。

索引モデルが issue の本文から書いたものです。

説明

2D 3D A-Dynamics C-Bug D-Difficult P-Medium

When standing on top of a vertically moving platform, the kinematic character controller doesn't stay stuck to the platform. Instead it kind of bounces and dips into the platform. This can be observed here:

https://user-images.githubusercontent.com/1753624/236084741-bbf633cd-cd61-4202-87a2-c1cead4f2598.mp4

If you constantly move while standing on top of the platform, this bouncing effect is canceled out:

https://user-images.githubusercontent.com/1753624/236084973-f924363a-abe3-4ea2-8682-06e5a0656e69.mp4

And sometimes you can fall through the platform entirely:

https://user-images.githubusercontent.com/1753624/236087175-46d4fdf2-5b14-49fa-adf9-dba2e10362cf.mp4

This example uses Rapier.js but I don't think this is specific to the WASM version.

Here's our character controller settings:

const characterController = physicsWorld.createCharacterController(0.1);
characterController.enableAutostep(0.7, 0.3, true);
characterController.enableSnapToGround(0.3);
characterController.setCharacterMass(100);
characterController.setApplyImpulsesToDynamicBodies(true);
characterController.setSlideEnabled(true);

And here you can see where we compute the character controller position:
https://github.com/matrix-org/thirdroom/blob/e4c1a24a21e6d7300c7dabc5055b93ed6847ac3a/src/plugins/KinematicCharacterController.ts#L263

The platform is a kinematic rigid body (RAPIER.RigidBodyDesc.kinematicPositionBased()) which is moved using: body.setNextKinematicTranslation(_v)
https://github.com/matrix-org/thirdroom/blob/e4c1a24a21e6d7300c7dabc5055b93ed6847ac3a/src/engine/physics/physics.game.ts#L239

Here's the example live, you'll need at least a guest account to view it:
https://deploy-preview-599--thirdroom.netlify.app/world/#websg-v1-dev:thirdroom.io

You can also see this live in another example using Rapier and react-three-fiber:
https://game-sandbox.vercel.app/
https://github.com/alexandernanberg/sandbox

https://user-images.githubusercontent.com/1753624/236088614-5f57bd75-1c4a-44c7-bdfb-c491ca79c48a.mp4

@NateTheGreatt and I have looked at the code in the Rust implementation of the character controller and tried tweaking things. However, we're not exactly sure where to look. We're happy to help fix the issue but could use some help figuring it out.

主要言語
Rust
スター
5.9k
フォーク
410
平均マージ
3時間 59分
マージ済み PR(30日)
10

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

dimforge/rapier のほかの issue

dimforge/rapier の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。