How do I detect a specific collision

  • Hey all,

    I have some compound objects that make up a character. Part of each character is a physics object and a ground detector. I use the ground detector to detect overlaps in solids and upcoming collisions. The problem I have is that I need to be able to use the ground detector and ask if I am colliding with a physics object. That way if one character stands atop another he can jump off/know if he is on the ground.

    I keep the physics object uid in a variable called "MyCollider" stored in the object ground detector.

    I basically need to be able to find out if I am overlapping any physics objects that belong to characters but not read the one that belongs to the current character (the ground detector is always overlapping the physics object that makes up the character)

    does this make sense?

  • You might want to try using instance variables and set their values to true/false. then check the value before executing the overlap logic.

    Alternatively, this might be where you can use families as well and put the physics objects you want to process in a family.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • They are in families. Everything I make is always in a family, except for debug objects and such. All characters in the game (player controlled, and ai) have a physics object that is in the family Character_Coliders. Each Ground detector for every character in the game is of the family Character_StateManager. This manager controls numerous objects that check nearby for walls, cieling, and floor. It also runs some ray-tracing if needed.

    Long story short I run the following logic:

    For each Character_State...

    is overlapping (any object that should be solid including character coliders)?

    The problem is that will always be true because the state is overlapping its own objects collider. I need to somehow obtain a list of objects that it is overlapping and if it is only overlapping 1 object I can see if that objects uid matches the stored uid of the collider belonging to the character. Iv tried but somewhere the subtleties of the list of objects construct 2 selects has escaped me. I could program this in a heart beat but I can't seam to event script it.

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