Jump to content

Physics.ARCADE collision trouble. Sprite fall through the another sprite if hight velocity.


Branlin
 Share

Recommended Posts

Example: https://jsbin.com/cakorijiqi/1/edit?js,output

Physics.ARCADE collision trouble. Sprite fall through the another sprite if hight velocity.

If you change the value from 500 to 100 in the velocity, then the problem does not occur.

this.boxGroup.setAll('body.velocity.y', 500);

What is the cause of the problem?

And I have noticed. If the swap these lines (#2, #3), the box to fall through the floor.

function update() {//#1
  game.physics.arcade.collide(this.boxGroup); //#2
  game.physics.arcade.collide(this.floor, this.boxGroup);//#3
}//#4

Sorry for my English. :)

Thanks.

Link to comment
Share on other sites

This is a consistent issue with Arcade Physics.
The reason why it happens is the sprite is moving fast and the checks happen based on FPS. So with a little division you will see that means there is space between collision detection for high speed sprites.

Only real way I know how to fix this is to look for the previousPosition and draw a line from that point to the current position, check if it collided and then move the sprite back.

Link to comment
Share on other sites

  • 2 years later...
 Share

  • Recently Browsing   0 members

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