Jump to content

arcade collision without body.velocity


ageibert
 Share

Recommended Posts

You can mitigate the 'sliding' by either zeroing the velocity when the player isn't holding a direction, or setting the body.drag.x and .y values to something very high. Otherwise collisions will not be properly calculated, as velocity is used within the collision calculation. You can try setting body.moves = false and then move the character manually and hope the separation routine doesn't go too crazy - it's definitely worth trying in your particular scenario.

Link to comment
Share on other sites

i've chosen the body.drag solution and tweaked it with setting the speed (velocity increment) accordingly.

additionally i set the maximumVelocity, so that the player doesn't accelerate too much.

 

now my player still slides a bit, but that's ok for me.

 

Thank you for that! :)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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