Path follower with physics (Arcade)

Hey y’all, I’m new to Phaser 3. I’ve managed to draw a path and I’ve gotten a sprite to follow it but I can’t seem to set any collisions with it? I’m not sure where I’m going wrong?

  createMiniBoss() {
    let path = new Phaser.Curves.Path(50, -50)

    path.lineTo(50, 50)
    path.lineTo(450, 50)
    path.lineTo(450, 100)
    path.lineTo(50, 100)
    //... the path is longer 

    // let miniBoss = this.miniBoss.create(50, -50, 'mediumEnemy')
    let miniBoss = this.add.follower(path, 50, -50, 'mediumEnemy')
    miniBoss.setScale(2)

    miniBoss.startFollow(20000)

    let randomShootStart = Phaser.Math.RND.between(250, 750)

    this.time.addEvent({
      delay: randomShootStart,
      callback: () => this.fireEnemyLaser(miniBoss),
      repeat: -1,
    })

    this.time.addEvent({
      delay: 20100,
      callback: () => miniBoss.destroy(),
    })
  }

What are you trying to do? You can’t collide a path, but you can collide the sprite against something else.

I’m trying to collide the sprite against another sprite, my laser. The enemyShip collision is working but the miniBoss collision is not

fireLaser() {
if (this.nextShotAt > this.time.now) {
return
}

this.nextShotAt = this.time.now + this.shotDelay

if (this.keys.space.isDown) {
  let laser = this.laserBolt.create(this.playerShip.x, this.playerShip.y, 'laserBolt')

  laser.body.velocity.y = -600

  this.physics.add.overlap(this.enemyShip, laser, this.enemyShipDie, null, this)
  this.physics.add.overlap(this.miniBoss, laser, this.miniBossShot, null, this)

  this.tweens.add({
    targets: laser,
    scale: 3,
    duration: 300,
    yoyo: true,
    repeat: -1,
  })

  this.time.addEvent({
    delay: 1200,
    callback: () => laser.destroy(),
  })
}

}

Turn on Arcade Physics debug and confirm that the sprites all have bodies.

But my guess is you need

this.physics.add.existing(miniBoss);

Thank you! The debugger helped a great deal. I was also misunderstanding how the object was being referenced in my code. I’m still very new to this and I really appreciate your help!