Hello,
I believe there is some sort of a bug when adding reference to the facebook instant games SDK and applying physics transformation on my objects
this is my index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="full-screen" content="yes" />
<meta name="screen-orientation" content="portrait" />
<script src="https://connect.facebook.net/en_US/fbinstant.6.2.js"></script>
<script src="src/scripts/phaser-facebook-instant-games.min.js"></script>
<link rel="stylesheet" href="./src/css/index.css" />
<title>Documents</title>
</head>
<body>
<div id="game-container">
<div id="content">
<h1></h1>
<p></p>
</div>
</div>
</body>
</html>
And this is what I’m trying to do once the game starts:
this.player = this.physics.add.sprite(this.game.renderer.width / 2 - 8, this.game.renderer.height - 130, CST.SPRITES.PLAYER).setScale(0.2, 0.2).setDepth(1);`
this.player.body.setSize(this.player.width - 120, this.player.height - 120, true);
this.player.body.setOffset(60, 60);
this.playerContainer = this.physics.add.group();
this.playerContainer.setOrigin(this.player.x, this.player.y);
this.playerContainer.add(this.player);
Whenever I call this.playerContainer.setOrigin(this.player.x, this.player.y);
It shows me the following error:
GameScene.ts:762 Uncaught TypeError: this.playerContainer.setOrigin is not a function
at GameScene.create (GameScene.ts:762)
at initialize.create (phaser-facebook-instant-games.min.js:1)
at initialize.bootScene (phaser-facebook-instant-games.min.js:1)
at initialize.start (phaser-facebook-instant-games.min.js:1)
at initialize.processQueue (phaser-facebook-instant-games.min.js:1)
at initialize.update (phaser-facebook-instant-games.min.js:1)
at initialize.step (phaser-facebook-instant-games.min.js:1)
at initialize.step (phaser-facebook-instant-games.min.js:1)
at e (phaser-facebook-instant-games.min.js:1)
Also my preloader is this one:
his.facebook.once('startgame', () => {this.scene.start(CST.SCENES.OPENING);}, this);
this.facebook.showLoadProgress(this);
//....Spritesheet loading here
I appreciate your help on this. Thank you