Jump to content

P2 - fixedRotation causing troubles


t-w-in
 Share

Recommended Posts

Hello, can you please help me?

I require non-rotating crates. Like in this oficial example: http://phaser.io/examples/v2/p2-physics/platformer-material , where I add just one line box.body.fixedRotation = true; to the for cycle creating the boxes.

Suddenly, they start to shift and slip. I need them to stay still. 

How can I fix this? Do you have any idea please? I would be very greatful! I have tried using different materials, but notning helps. Friction is just gone :( 

Link to comment
Share on other sites

  • 2 months later...

<disclaimer>I know nothing about P2, never used it</disclaimer>

I played around with the example a bit, and it seems to be caused by box/box friction. So you could try this:

var boxBoxCM = game.physics.p2.createContactMaterial(boxMaterial, boxMaterial, { friction: 0 });

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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