How to implement complex collision rules with tags and without custom collision object types?

In my project, I have now 7 custom collision channels (including one trace channel) of 18 possible, and this number grows non-linearly over the time. I guess in this or next year I will hit the limit. I have ever read somewhere in the Internet that it is possible to implement some custom collision functionality (for example, block some WorldDynamics and overlap some other ones) with using tags without the custom channels. Who knows how to do this and what is possible with this?

Bump. The topic is actual.

Double bump.

Triple bump.

Quadruple bump.

Quintuple bump.

Do you mean something like this?

It is a solution from 2014 but I think the tag system still works kinda the same.

Hello @XxpiingyxX! Does it work only with BeginOverlap? Are line traces and blocking collisions impossible with this?

It should work with Line Trace if you also use the branch node. You just have to find a work around for your specific problem.

For example: You can get an actor and then use the Actor has tag node to check if that
actor has the specific tag assigned. Then if it has the tag you use the True execution to do your line trace on that actor (or whatever you want to do), and if it doesn’t have the tag you use the false to skip that actor and maybe try another one.

Or: you can use the Get All Actors with Tag to get all the actors with the specified tag assigned. Then you can use that array to maybe ignore them in a line trace or maybe change their collision.

@XxpiingyxX, thanks! But I guess blocking collisions are the most hard to reach with tags, aren’t they? Is this actually possible?

How do you mean? Like the actor doesn’t have any collision at all, or that just sometimes the actor won’t have any collision? Do you have a more concrete example? :face_with_diagonal_mouth:

1 Like

You can assign object types and collision channels dynamically, on the fly, run-time. You can even set entire profiles and switch between them. If you run into scenarios where more than 18 channels are needed simultaneously, then I’d question the design to start with.

What exactly are we dealing with? A science project? 5D chess!? :slight_smile:

2 Likes

Hello again @Everynone! I have marked your answer as the solution, but later have thought: I doubt that chess-like game needs extra collision channels at all, and science projects are not created on game engines, but what if it is a big open seamless multiplayer world? When, for example, several players come to the magic barrier, and some of them must block it whereas some must overlap, which, of course, requires separate collision channel with different responses of different players to that channel - at the same time some other players may fight with the enemies that have damage zone near mesh (fire daemons that scorch etc.) and this zone must overlap “Pawn” (and vice-versa) and ignore everything else and must not appear in nearby line traces, which requires another collision channel - and some other players may, for example, build workshops that have nearby zone in which one may not build the other identical workshop but that zone must not interfere anything except identical zones (such as players, enemies or line traces) so this zone must block its copies but ignore everything else, which requires another collision channel and so on. And how to avoid exponential growth of collision channels and facing limit in this situation?

Many ways to approach this.

You can use overlap collision on Pawn → Is foe → repel & damage. Otherwise ignore the pawn. Block everything else.

Bump. The topic is actual. The previous post is not an answer.

Re-evaluate design approach, what you’re doing is not sustainable. Name the channels in a more generic ways an reuse them for various purposes. Do look into profiles if you have not done so already.

some of them must block it whereas some must overlap, which, of course, requires separate collision channel with different responses of different players to that channel

This is the thing you’d reuse all over the place for this, find other purposes for the same channels, too. I actually do not see a problem here. Hard to imagine a scenario bar some deeply convoluted simulation that would require more than a dozen channels. Perhaps I’m missing something

Good luck.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.