When my player object (kinematic body) is in contact with the barriers I set up (collisionShape2D nodes), it screws up the collision with enemy mobs and stops them from despawning on contact. This is my first project and I have no clue what could be causing this.
This is my collision code on my player node:
var collision_check = move_and_collide(motion * delta)
# Check for collision with enemies
if collision_check != null && collision_check.collider.is_in_group("Targets"):
take_damage(self, collision_check.collider.contact_damage)
collision_check.collider.queue_free()
VIdeo of bug