Solid Behavior Collision Filter for Object Instances

0 favourites
  • 5 posts
From the Asset Store
Welcome! I-Spy (Hidden objects) is an educational puzzle that is more than just seek-and-find activities.
  • UPDATE Aug 30, 2022

    With help from a fellow C3 user in the Discord chats, it has been unofficially determined that this is a bug with the 8Direction behavior. I will be filing a bug report soon...

    INTRO

    I'm working on a top-down shoot-'em-up title. The arena is broken up into 9 different areas. The walls that define the areas have doors that only the enemy called "Manager Mike" can go through.

    THE INTENDED DESIGN

    There is a "Door Trigger" object that has the Solid behavior that is enabled or disabled depending on whether or not "Mike" is overlapping the object or not. "Mike" is using the custom obstacle element of the Pathfinding behavior, so the Solid behavior does not factor in. The "Trigger" object is set in the space where the Player can move from area to area.

    If "Mike" is overlapping the "Trigger" while going through the door space between the area walls, then the Solid behavior of the "Trigger" is disabled. While disabled, the Player can also slip through the door space. (Previously, I tried using Collision Filter and Solid behavior tags but that proved fruitless.) So long as "Manager Mike" is not overlapping the "Door Trigger" object, then that object instance's Solid behavior is enabled and the Player cannot move from area to area.

    THE PROJECT

    Project Link: https://drive.google.com/file/d/1_yERwqONQJrVzpiV-byvCKChDOXqD782/view?usp=sharing

    Event Lines: 30 - 43

    THE PROBLEM

    As you can imagine, this isn't working. "Manager Mike" moves through the door spaces just fine. Because of the custom obstacle element, it ignores the "Trigger" object's Solid behavior as it should. The problem is that the Solid behavior, even while enabled (I've checked via the debug mode), acts as if it doesn't work when the Player moves up to it. The Player moves past the "Trigger" object as if it were disabled even though it is clearly enabled and "Mike" is not overlapping the "Trigger".

    ADDENDUM

    Elsewhere in the project (event lines 58 & 59), the Player does make use of the Collision Filter via Solid tags for the Walls object. And the curious thing is that the Wall object instances all work properly - the Solid behavior keeps the Player from moving through them. However, the "Door Post" object also has Solid behavior attached to it (and a tag which is not referenced) but the Player can move through it. So, I am at a loss of how to resolve this issue and what it is I am missing.

  • The set solid collision filter is an action associated with the player object, not the door, so picking the door has no effect on this action.

    I don't think this collision filtering is the best fit here. First thing that comes to mind would just be to enable and disable the solid behavior for the door that is being overlapped.

  • I don't think this collision filtering is the best fit here. First thing that comes to mind would just be to enable and disable the solid behavior for the door that is being overlapped.

    Agreed. And I actually tried to do that after making this post. But for some reason, that doesn't work, either. It must be one of the nuances of how events are checked (re: grouped conditions versus sub-conditions).

  • oosyrag - I completely updated my post here to hopefully make it more clear. I also included an updated image that should help things be more understandable as well as a copy of my project file. I hope this helps.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you use inclusive solid filtering mode on your player sprite on the wall, it will only treat walls as solid, and nothing else. Your player shouldn't need any filtering.

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