fix: if not addedToPhysics on destroy body will be undefined
This commit is contained in:
parent
271d71c5fc
commit
883837006f
|
@ -50,7 +50,7 @@ export class Physical extends decorate(Trait) {
|
|||
}
|
||||
|
||||
removeFromWorld() {
|
||||
if (this._world) {
|
||||
if (this._world && this._body) {
|
||||
this._world.removeBody(this._body);
|
||||
}
|
||||
this._body = undefined;
|
||||
|
|
Loading…
Reference in New Issue
Block a user