How do I best handle collisions between 2 players?

0 favourites
  • 4 posts
From the Asset Store
Best car suspension with spring effect and very cool terrain generation.
  • I was told that the Physics behavior is not great on mobile. Especially with several other physics objects on screen (all moving).

    Using the 8 Direction movement behavior - is there a better way to handle collisions between 2 players (so that they cannot overlap each other). I'd prefer it if a player was trying to move in a direction and another player was in the way, then the moving player "pushes" the other player slowly.

    This is doable with the Physics behavior, but is this the best way to go - Even if it harms performance? - My concern being that I don't really need "physics" in my game other than that instance where two players collide and shouldn't overlap, so I fear that it may not even be worth adding, unless I am thinking too much and the performance difference is minimal (I plan on having several players on screen at once, and the game will likely run on mobile).

    Thanks for any input that you can provide.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Try the custom movement behavior - there is a "push out solids" action you can use. You can use this in addition to your physics or 8 direction behaviors, along with the solids behavior.

  • Push out solids doesn't work well with two moving objects. It looks far too glitchy on contact the objects warp randomly around each other

  • Push out solids at angle gives you a little more control.

    How fast are your players moving, in terms of how many pixels might they overlap on the collision frame? Also are your players irregular shapes?

    Try testing your game with physics on the target device, you might not even have anything to worry about. Preview over lan is a feature to help you easily test on mobile.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)