# Parameter for Matter.js

**URL:** <https://phaser.discourse.group/t/parameter-for-matter-js/1611>\
**Category:** Phaser 3\
**Created:** [March 9, 2019, 12:08am UTC](https://phaser.discourse.group/t/parameter-for-matter-js/1611 "2019-03-09T00:08:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![losos](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/losos/32/532_2.png) [@losos](https://phaser.discourse.group/u/losos)\
**Post date:** [March 9, 2019, 12:08am UTC](https://phaser.discourse.group/t/parameter-for-matter-js/1611/1 "2019-03-09T00:08:19Z")

</div>

Hello! when i wanna set object like parametr collision get error

> Uncaught TypeError: Cannot set property ‘gameObject’ of undefined

My example code look like this:

> this.load.json(‘shapes’, ‘assets/shapes.json’); // initialize fun  
> this.load.atlas(‘sheet’, ‘assets/atlas.png’, ‘assets/atlas.json’);  
> var shapes = this.cache.json.get(‘shapes’); // create fun  
> var ground = this.matter.add.sprite(0, 0, ‘sheet’, ‘background’, {shape: shapes.background});

Object is created via editor, here is my code of json object [{ "generator\_info": "Shape definitions generated with PhysicsEditor. Visit htt - Pastebin.com](https://pastebin.com/FytNmyGX)

Where is problem?

---

<div class="post-metadata">

**Author:** ![losos](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/losos/32/532_2.png) [@losos](https://phaser.discourse.group/u/losos)\
**Post date:** [March 9, 2019, 3:23am UTC](https://phaser.discourse.group/t/parameter-for-matter-js/1611/2 "2019-03-09T03:23:38Z")

</div>

I have solution, must uptade Phaser to 3.16 from 3.8 because object adding by matter.add.sprite not have a “centerMass”.
