Skip to content

Commit

Permalink
fix(physics): remove collision listeners on remove actor
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaisthorpe committed Jul 3, 2024
1 parent 1a29650 commit a2ff636
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/nasty-items-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tedengine/ted': patch
---

Delete collision listeners on remove actor
3 changes: 3 additions & 0 deletions packages/ted/src/core/world.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ export default class TWorld {
};

this.queuePhysicsStateChange(sc);

// Remove any listeners that have been registered
delete this.collisionListeners[component.uuid];
}

private registerActorWithPhysicsWorker(actor: TActor) {
Expand Down

0 comments on commit a2ff636

Please sign in to comment.