Jump to content

physcis arcade rotation collision problem

Recommended Posts


i don't see where is my error with this snippet


i want receive a collision between a object who's rotating and another.

if a put my "projectile" on "axe" i receive a notification but nothing with the rotation ???

thanks for your help

var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload:preload, create: create,update: update });

function preload() {
   game.load.image('circle', 'https://s13.postimg.org/xjhlzmiev/disc_png.png');
   game.load.image('rect', 'http://s10.postimg.org/6fa6mgrd5/motif.jpg');

function create() {



game.physics.arcade.enable(this.axe);			game.physics.startSystem(Phaser.Physics.ARCADE)


function update(){
this.axe.body.rotation += 1;	game.physics.arcade.collide(this.axe,this.projectile,this.projectile.touch,null,this)



Link to post
Share on other sites

I've added some debug lines to your code:


As you can see the arcade body is not rotating together with the sprite.
And, from what I read in the docs, I don't think that it is possible to do so.


Please understand that the collision Body itself never rotates, it is always axis-aligned. However these values are passed up to the parent Sprite and updates its rotation.



Have you tried with P2 physics?


Link to post
Share on other sites

hi @mattia,

thanks for your comment.

I had imagined that the problem comes from the fact the body did not turn.
I wanted to use arcade physics to use the least possible resource. pity.

A question:  is it possible to use p2 physics and arcade simultaneously ?
Or is it a bad solution and is it better to use only p2?

Link to post
Share on other sites
  • 2 weeks later...

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.

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.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...