How can I make an external collision ignoring by overlaping 2 internal collisions?

So, the character is practically 2D, it has a gun with a key collision, and there is a lock collision above the character, a sensor to see if there is any trespassable surface below,and also there is the trespassable surface at the question below it. What we supposed to get is, when the player aims above, when gun and lock collisions are overlapping, if the player presses the S key at the same time, the surface which is overlaping with the sensor collision should be ignoring for 1 second. How can I achieve that? I am quite of a newbie sorry, I will be thankfull if anyone could help.

By the way, every component except the trespassable surface here is a part of the character. And there will be multiple trespassable surfaces along the map.

Try this node:

”Target” should be the collider component you want to change.
”Channel” should be the profile of the collisions you want to ignore.

After a second use it again, just change the “New Response” to Block or Overlap depending on your initial setup.

1 Like

You think should I add this into the character or the “trespassable surface”?

Tbh I have no idea what you are actually doing, so my guess would be only a guess. I usually try to think about it this way:
if it’s the character’s ability – do it in the character.
If it’s a feature of the surface/object, then do it in the surface/object.

For example, if you have a barrel that explodes when hit, you should script it in the barrel. But if it’s an exploding bullet, then you script the bullet instead of every possible surface it can hit.

Hope it helps. In the end, in my experience (which might be different for others), deciding what goes where and how to organize scripts and stuff is one of the most difficult things, because there are always hundreds of ways to do things, and none of them is perfect – you just need to find the least bad one :smiley:

1 Like