Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#488 1 commento 12 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
javascript, rust, wasm
Ambito
game-dev

Direzione di ricerca

Riproduci il problema usando gli esempi collegati, poi leggi src/plugins/KinematicCharacterController.ts intorno alla riga 263 e physics/physics.game.ts intorno alla riga 239. Confronta il comportamento di JavaScript con l’implementazione Rust del character-controller e il movimento della piattaforma di kinematicPositionBased. Il lavoro è concluso quando il controller rimane su una piattaforma che si muove verticalmente senza rimbalzare, sprofondare o cadere attraverso di essa.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Rust
Stelle
5.9k
Fork
410
Merge medio
3h 59m
PR unite (30g)
10

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di dimforge/rapier

Tutte le issue di dimforge/rapier

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.