CustomMovement Family collision problem

This forum is currently in read-only mode.
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • I have a player-controlled Object and a Family of colliders. I need the Object to pass through some Family Members, while sliding around others, the behaviour being chosen using a Private Varable/comparison condition.

    No matter what I do, I'm unable to bounce/slide my object off only select Family members - all the members are always taken as a collider. I have:

    On Object Overlaps Family Member

    Family Member PV is greater than SomeNumber

    ->Object bounce off Family Member

    Now the issue happens when the Object is already overlaping a Family Member that fails the comparison and comes into contact with another that passes it - the failed member is still used as a collider for the bounce.

    How could I rectify this? Any help would be appreciated.

  • Have you tried adding loop for each Family Member on top of all that?

    And if that doesn't work you could try on collision with family member instead of overlaps family member.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have, but it does not seem to make a difference.

    Here's where I managed to get to. The collisions work as I want them to, except when the Player_Tile overlaps a tile that fails the comparison test while colliding with one that passes it. Left and Right arrow keys rotate the Player_Tile. Up, Down to move forward/reverse.


  • Aha it seems something is wrong with the bounce action.It picks all instances of the sprite instead of one.


    The best workaround i can think of.Let me know if you can't figure out how it works.

  • Thank you for the continuing assistance.

    I see... You're using a rounded off angle from the Rectangle_Tile pivot to the Player_Tile to shift it back... This works, but the more the tile becomes stretched, the more that shift will become, leading to problems.

    In the interim, I had come up with something which similarly avoids making use of the Rectangle_Tile data - basically, Player_Tile.XY is recorded to a PV at every tick and as soon as a collision is detected, Player_Tile is shifted back to the last recorded position, which is always a tick before the overlap.

    This is fullproof in terms of collision testing, but I lose your wall sliding effect, which is what I'm after as well...

    After seeing your file, I seem to have achieved a solution that fully satisfies all my requirements. The pre-requisite is knowing which condition/actions pick which objects ... Based on my testing:

    Conditions - Sprite - Is Overlapping and On Colision always picks only the pair of objects that are currently colliding.

    Conditions - System - Collision/Overlap conditions always pick all the object instances that collide in the whole cycle/tick

    Actions - CustomMovement Bounce always picks all the object instances that collide in the whole cycle/tick.

    So, what I did was to create a Collision_Tile that gets positioned exactly over the Rectangle_Tile once a Rectangle_Tile Overlaps With condition is passed. Then, Player_Tile is bounced off the Collision_Tile with 0 friction, which positions it right outside the collision mask, preserving the sliding motion.

    Sorry for the wall of text. Here's a modified .cap which illustrates all the above. Thanks again for your help.

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