Get solid enemies to pass one another

0 favourites
From the Asset Store
Assets for creating mountains and ravines environments
  • I have a family called enemies, with platform enemies in the family. These platform enemies have their solid behaviour enabled. Now, what I want to do is have these solid platform enemies to move past each other when they collide. In a sense I need the enemies to push against the player.

    The first thing I tryed was this:

    System>>>Event: FamilyEnemies on collision with FamilyEnemies

                        >>>>Action: FamilyEnemies set collisions disabled

    The problem with this is that I have a solid platform sprite underneath, and that when collisons are disabled, the enemies just fall down through the ground platform.

    The logic would be like this:

    --->>if FamilyEnemies collides with FamilyEnemies

        ----->>>then Family enemies pass through each other

    Does anyone know how I can do this? Help is appreciated

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I suppose the first question is do your enemies really need to be solid?....

  • yes, they HAVE to be solid

    I suppose the first question is do your enemies really need to be solid?....

  • Well,solids are just that..."solid" and they cannot pass each other.

    you can disable the solid behavior when they collide,and once passed re enable....

  • Well,solids are just that..."solid" and they cannot pass each other.

    you can disable the solid behavior when they collide,and once passed re enable....

    I did try that but the problem is that there is a platform below that is also solid, so when two solid enemies disable their "solid" state they both fall through the platform.

    I need it so that the enemy acts as a barricade to push the player back, but when the two enemies collide with each other they should turn off their solid state and pass through.

  • When I say to push the player back, I don't mean a knock-back effect

  • The only ways I could think of at the moment,would be to hold the y position of the objects while the pass is happening...

    or maybe on collision have both objects spawn dummy objects,destroy the originals...the dummies could pass each other,then once passed have the dummy objects recreate the originals.

    or maybe have the sprites switch x positions on impact and cover the "switch" with an animated sprite showing the "fake pass".

  • Hmh...i have an idea, although i dont know how to express it in a theoric way, as im new xD

    My idea would be to have 2 scenes, and a player character in each one, one pinned to the other one...

    then have one solid in one scene and the other one in the other one, this way they wouldnt collide, and if a player is above one of them, it wouldnt fall down...

    Hope this makes some sense, im a newbie, and im just trying to help a little, i dont know the exact commands to do this, im not even sure if you can have two scenes in the same layout, but...well, that would be my idea xD

  • I'll try the first method

    The only ways I could think of at the moment,would be to hold the y position of the objects while the pass is happening...

    or maybe on collision have both objects spawn dummy objects,destroy the originals...the dummies could pass each other,then once passed have the dummy objects recreate the originals.

    or maybe have the sprites switch x positions on impact and cover the "switch" with an animated sprite showing the "fake pass".

  • I do appreciate the thought, but this wont solve my problem

    Hmh...i have an idea, although i dont know how to express it in a theoric way, as im new xD

    My idea would be to have 2 scenes, and a player character in each one, one pinned to the other one...

    then have one solid in one scene and the other one in the other one, this way they wouldnt collide, and if a player is above one of them, it wouldnt fall down...

    Hope this makes some sense, im a newbie, and im just trying to help a little, i dont know the exact commands to do this, im not even sure if you can have two scenes in the same layout, but...well, that would be my idea xD

  • Well this is a blatant case of me cheating but see if you can take this idea further.. basically abuse animations to set different collision areas, one allows them to pass over one another, another makes them full blockers when near a player.

    dl.dropbox.com/u/116137178/Help/HelpWithColliders.capx

  • just give them platform behavior and then they wont fall though the solid "floor" piece.

    platform behavior works with solids, you dont need to have them set to solid behavior and they will not pass solids.

    Be sure to disable default controls, it the enemies.

  • just give them platform behavior and then they wont fall though the solid "floor" piece.

    platform behavior works with solids, you dont need to have them set to solid behavior and they will not pass solids.

    Be sure to disable default controls, it the enemies.genius

  • As I mentioned before they have to be solid to act as a wall to block the player. So imagine dudes carrying shields pushing/shoving against the player. I did decided to place the solid on the player and leave the enemies with platform behavior with no solid. then whenever the player comes on collision with the enemy, vector x of the player is subtracted by nth value

    just give them platform behavior and then they wont fall though the solid "floor" piece.

    platform behavior works with solids, you dont need to have them set to solid behavior and they will not pass solids.

    Be sure to disable default controls, it the enemies.

  • Did you try my capx?

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