# Problem with Matter Plugin

**URL:** <https://phaser.discourse.group/t/problem-with-matter-plugin/11682>\
**Category:** Phaser 3\
**Created:** [May 12, 2022, 6:14am UTC](https://phaser.discourse.group/t/problem-with-matter-plugin/11682 "2022-05-12T06:14:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cannabijoy](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/cannabijoy/32/1511_2.png) [@Cannabijoy](https://phaser.discourse.group/u/Cannabijoy)\
**Post date:** [May 12, 2022, 6:14am UTC](https://phaser.discourse.group/t/problem-with-matter-plugin/11682/1 "2022-05-12T06:14:48Z")

</div>

I am getting an error message with the Phaser Matter Collision Plugin. It’s been a while since I did anything with Phaser, and when I went to work on my old games, nothing is working.

I am using jsdelivr to get Phaser 3 and the plugin. My html head looks like this:

```javascript
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>

<script src="//cdn.jsdelivr.net/npm/phaser-matter-collision-plugin"></script>

```

In my js file, I have exactly what the website says to do:

```javascript
plugins: {
    scene: [
   {
    plugin: PhaserMatterCollisionPlugin, 
     key: "matterCollision",
     mapping: "matterCollision"
        }
     ] },

```

I was originally using Phaser v. 3.16.2, but that doesn’t recognize the plugin at all. When I switch to the newer version, I am getting errors:

**Invalid Scene Plugin: matterCollision**

And:

**TypeError: undefined is not an object (evaluating ‘this.matterCollision.addOnCollideStart’)**

This is where I’m getting the directions from:

> **[phaser-matter-collision-plugin](https://www.npmjs.com/package/phaser-matter-collision-plugin)**
>
> A plugin for making it easier to manage collisions with Phaser + Matter.js. Latest version: 1.0.0, last published: 9 months ago. Start using phaser-matter-collision-plugin in your project by running \`npm i phaser-matter-collision-plugin\`. There is 1...

Thank you!

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [May 13, 2022, 12:24am UTC](https://phaser.discourse.group/t/problem-with-matter-plugin/11682/2 "2022-05-13T00:24:06Z")

</div>

Can you do

```
console.log(PhaserMatterCollisionPlugin);

```

?

---

<div class="post-metadata">

**Author:** ![Cannabijoy](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/cannabijoy/32/1511_2.png) [@Cannabijoy](https://phaser.discourse.group/u/Cannabijoy)\
**Post date:** [May 13, 2022, 7:34am UTC](https://phaser.discourse.group/t/problem-with-matter-plugin/11682/3 "2022-05-13T07:34:43Z")

</div>

Yes, all I get is:

> {  
> }

---

<div class="post-metadata">

**Author:** ![Cannabijoy](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/cannabijoy/32/1511_2.png) [@Cannabijoy](https://phaser.discourse.group/u/Cannabijoy)\
**Post date:** [May 29, 2022, 5:39am UTC](https://phaser.discourse.group/t/problem-with-matter-plugin/11682/5 "2022-05-29T05:39:47Z")

</div>

I figured it out. I needed PhaserMatterCollisionPlugin.default when using the CDN. It’s always the simplest thing 🫠

---

<div class="post-metadata">

**Author:** ![dragzter](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/dragzter/32/7285_2.png) [@dragzter](https://phaser.discourse.group/u/dragzter)\
**Post date:** [January 13, 2023, 3:13pm UTC](https://phaser.discourse.group/t/problem-with-matter-plugin/11682/6 "2023-01-13T15:13:06Z")

</div>

Thank you!
