P2 bodies do not collide with world unless updateCollisionMask is called

Aperta
#257 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
backend, game-dev

Direzione di ricerca

The report points to updateCollisionMask() and the body constructor, but gives no file or test path. Read the constructor and the existing call made when collideWorldBounds changes, then reproduce the issue with the linked demo. Done when world bounds collision works without manually calling updateCollisionMask().

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

Descrizione

documentation help wanted

I was having trouble getting a body to collide with the world, and I finally realized that the collision only worked if I called updateCollisionMask() on the body. Right now this is only called by Phaser when you toggle the value of collideWorldBounds, so maybe the fix is just calling it at the end of the constructor of the body? I'm not too sure...

There is a demo at https://codepen.io/javidcf/pen/RgajRb. World bounds collision only works when line 30 (containing the call to updateCollisionMask) is uncommented.

I am using Phaser-CE v2.8.0

Lingua principale
JavaScript
Stelle
1.4k
Fork
485
Merge medio
1g 2h
PR unite (30g)
9

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 phaserjs/phaser-ce

Tutte le issue di phaserjs/phaser-ce

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.