Jump to content

Phaser 3 Matter Physics - createFromObjects


lapamplamouse
 Share

Recommended Posts

Hello, I using createFromObjects to create animated sprites from tiled into my game (they are coins). I wish for them to move across the screen when the player hits into them, by setting the angularVelocity. 

coins = road.createFromObjects('coin', 971, { key: 'coin' });
this.anims.play('spin', coins);

 

However they don't seem to want to move,  I can change the x and y coordinates, but I wish for this to be an animation of sorts.

coins[bodyB.id].angle= 200;
coins[bodyB.id].angularVelocity=10000;

logging the properties to the console, shows they are updating correctly. But the sprite does not move an inch.

console.log(coins[bodyB.id]);
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...