Bullets don't collide with tilemap but collide with other things

I am trying to have my bullets collide with my tilemap. I am able to have my player collide with the tilemap but I can’t seem to figure out how I can get my bullets to collide with the tilemap. My bullets will collide with other objects as well.

Bullet Class:

var Bullet = new Phaser.Class({

    Extends: Phaser.GameObjects.Image,

    initialize:
    function Bullet (scene){
        Phaser.GameObjects.Image.call(this, scene, 0, 0, 'bullet');
        this.speed = 0.15;
        this.born = 0;
        this.direction = 0;
        this.xSpeed = 0;
        this.ySpeed = 0;
        this.setScale(0.05)
    },

    fire: function (shooter, target){
        this.setPosition(shooter.x, shooter.y);
        this.direction = Math.atan( (target.x-this.x) / (target.y-this.y));

        // Calculate X and y velocity of bullet to moves it from shooter to target
        if (target.y >= this.y)
        {
            this.xSpeed = this.speed*Math.sin(this.direction);
            this.ySpeed = this.speed*Math.cos(this.direction);
        }
        else
        {
            this.xSpeed = -this.speed*Math.sin(this.direction);
            this.ySpeed = -this.speed*Math.cos(this.direction);
        }

        this.rotation = shooter.rotation; // angle bullet with shooters rotation
        this.born = 0; // Time since new bullet spawned
    },
    
    // Updates the position of the bullet each cycle
    update: function (time, delta)
    {
        this.x += this.xSpeed * delta;
        this.y += this.ySpeed * delta;
        this.born += delta;
        if (this.born > 1800)
        {
            this.setActive(false);
            this.setVisible(false);
            
        }
    }
});

Creating a class to use the bullets:

export default class PistolBulletClass {
    preload(scene){
        scene.load.image('bullet', Bullet)
    }

    create(scene){

        this.playerBullets = scene.physics.add.group({classType: Bullets, runChildUpdate: true});
}
 this.physics.add.collider(this.Player.player, this.Map.ground)
this.physics.add.collider(this.Player.brick, this.Bullet.playerBullets, hitBrick);
this.physics.add.collider(this.Bullet.playerBullets, this.Map.ground, hitWall)

The first two collision lines work and the last one doesn’t. Any help is appreciated! (Player.player is a physics image and Player.brick is a staticGroup)

In PistolBulletClass what are Bullet and Bullets?

How are you creating the this.Bullet.playerBullets?

import Phaser, { Game } from "phaser";

export default class Scene extends Phaser.Scene {
    constructor(Game, Map, Player, Bullet){
        super()
        this.Game = Game;
        this.Map = Map;
        this.Player = Player;
        this.Bullet = Bullet;
    }

    preload() {
        this.Map.preload(this);
        this.Player.preload(this);
        this.Bullet.preload(this);
    }

    create() {
        this.Map.create(this);
        this.Player.create(this);
        this.Map.map.createLayer('Shrub', this.Map.tileSet);
        this.Bullet.create(this)

        this.physics.world.bounds.setTo(0, 0, this.Map.map.widthInPixels, this.Map.map.heightInPixels)
        this.physics.world.setBoundsCollision(true)

        this.physics.add.collider(this.Player.player, this.Map.ground)
        this.physics.add.collider(this.Player.brick, this.Bullet.playerBullets, hitBrick);

        this.physics.add.collider(this.Bullet.playerBullets, this.Map.ground, hitWall)

    }

    update() {
    }

    shoot(){
        var bullet = this.Bullet.playerBullets.get().setActive(true).setVisible(true);
        if(bullet){
            bullet.fire(this.Player.player, this.Player.cursor);
        }
    }
}

function hitBrick(bullet, brick){
    brick.destroy();
    bullet.setActive(false).setVisible(false);
}

function hitWall(bullet, wall){
    console.log('here')
    bullet.setActive(false).setVisible(false);
}

Here is my scene that I use, I included only the important parts of it

I can’t really tell what’s what, but my first guess is that this.Bullet.playerBullets is undefined.

So I have my code setup by make variables of each thing I want in my scene and then I pass it into my scene:

let pistolBullet = new PistolBullet();
let map = new Map();
let player = new Player();
const game = new Phaser.Game(config);

const scene = new Scene(game, map, player, pistolBullet);

When I console.log my “this.Bullets.playerBullets” it shows a physics group with all of it’s properties. I just don’t understand how I can have the bullet collide with “Player.brick” but not with my tiled map but my player can collide with both the “Player.brick” and the tiled map. I once saw something that talked about using .setVelocity to move things but there is not such method for the bullets (but it does collide, just not with my tiled map).

You should use velocity for the bullets.