//in update method
call.physics.add.collider(bullet.rigid,gameState.Karl,()=>{
console.log(‘got hit’);
});
//also there is this weird box that is appearing
Hi,
Colliders must be created in the create function
this.physics.add.collider(spriteA, spriteB, (spriteA, spriteB) => {
console.log(‘got hit’, spriteA, spriteB);
}, null, this);
spriteA and B can be a physics group
Hi. thank you for replying but I already moved them into the create method and it’s still not working
I just found that the box that was was the bullet sprite and if a sprite hits that box it gets destroyed but not the actual bullet image, I do know where to even begin ti solve this problem please help.
Show us your code so we can help you, without it’s difficult