Ensure that 2 objects that move with the "pathfinder" behavior do not end up on top of each ?

0 favourites
  • 3 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Hello, I'm making a small game for mobile, I'm greatly inspired by Clash Royal for game play.

    I would like to know if it is possible to ensure that 2 objects that move with the "pathfinder" behavior do not end up on top of each other, and that if one is faster than the other than he can push it coming from behind.

    I specify that I have two active behaviors on the object (turret and pathfinder)

    I tried to make it a physical object, a solid etc but without success.

    Any help welcome

    Thanks !!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • One of the simpler effective decollision methods I've used is the bullet behavior to push objects away from each other.

    Default speed 0, with a high negative deceleration.

    Have your object in a family to check overlap with self. If overlapping with self/family, set bullet speed to an amount you want to push away, and set angle of motion for the object and family to away from each other.

    Adjust the bullet behavior numbers until you get a satisfactory amount of decollision knockback.

    Edit: note that most games that use this type of decollision do not do it every tick. Some do it only when every x seconds or on an asynchronous thread, and some only do it only when the object is at rest. You might also want to add other conditions to prevent an object getting yeeted across the screen if there are a lot of objects to collide with.

  • One of the simpler effective decollision methods I've used is the bullet behavior to push objects away from each other.

    Default speed 0, with a high negative deceleration.

    Have your object in a family to check overlap with self. If overlapping with self/family, set bullet speed to an amount you want to push away, and set angle of motion for the object and family to away from each other.

    Adjust the bullet behavior numbers until you get a satisfactory amount of decollision knockback.

    Edit: note that most games that use this type of decollision do not do it every tick. Some do it only when every x seconds or on an asynchronous thread, and some only do it only when the object is at rest. You might also want to add other conditions to prevent an object getting yeeted across the screen if there are a lot of objects to collide with.

    THANKS ! I understand the logic, I will look in this direction

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