Skip to content

Commit 356d50a

Browse files
committed
[bugfix] Fix collision type init
1 parent 32f5e5c commit 356d50a

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/engine/Actor.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -501,16 +501,12 @@ export class ActorImpl extends Class implements Actionable, Eventable, PointerEv
501501
if (shouldInitializeBody) {
502502
this.body = new Body({
503503
collider: new Collider({
504-
type: CollisionType.Passive,
504+
type: collisionType,
505505
shape: Shape.Box(this._width, this._height, this.anchor)
506506
})
507507
});
508508
}
509509

510-
if (this.body && this.body.collider) {
511-
this.body.collider.type = collisionType;
512-
}
513-
514510
// Position uses body to store values must be initialized after body
515511
this.pos.x = <number>xOrConfig || 0;
516512
this.pos.y = y || 0;

0 commit comments

Comments
 (0)