The opposite of NoCollisionConstraint: CollisionConstraint

As a Roblox developer, it is currently too hard to work with some cases of collisions where I only need a few specific parts to collide with each other. I’d like to request a “CollisionConstraint”. It is quite literally just the opposite of the NoCollisionConstraint.

Why would this be needed?
Let’s say you wanted to turn collision on between some specific parts, for a set amount of time. What you could do is use CollisionGroups. But say, you only want to enable collision between some specific parts, that would still need to collide with some other parts.
You could make 2 collision groups for each player, but the limit of collision groups is just a measly 32, so if you wanted to have a server of 100 players, you’d need 200 collision groups, which of course, not possible.

So to solve that issue, you could use the regular NoCollisionConstraints, and just put them in every single part that needs it, and remove the ones you don’t need for a specific amount of time.
The problem with this, is that you need more, and more, and more with each new part.
Say you had 2 parts. You only need 1 NoCollisionConstraint.
You have 4 parts. You now need 6 NoCollisionConstraints.
You have 8 parts, you need 28 NoCollisionConstraints…
And the number just keeps growing.
However, if we had CollisionConstraints, then I could just make 1 CollisionGroup that disables collision with itself, and then put CollisionConstraints only in the parts that need to collide, rather than putting them in every single one, and deleting them when needed.

But why can’t I just make another CollisionGroup which collides with the others? Because in that case, if another player had a part that should not collide with that players parts, then the two parts in the collidable group wouldnt be able to collide, when two players parts should never be able to collide.

A perfect example of this would be agar.io’s splitting system, where two players cells never collide (and can eat each other), but for some time after splitting, the player collides with itself, but other players still cant collide with the player and can therefore eat the player.

Hopefully it wasn’t too confusing, tried my best. (I’m not english, and this is my first feature request post)

If Roblox is able to address this issue, it would improve my development experience because I could manage complex collisions more efficiently and easily.

If I had a 100 player server, and all players had 8 parts, then I would need anywhere from 10000-160000 NoCollisionConstraints… That is absolutely insane

41 Likes

Seconding this - I want to avoid using collision groups as much as possible, and this would make it just as easy as using NoCollisionConstraints

6 Likes

Actually something like this may be made even easier by having a single instance class CollisionConstraint with a setting for whether to make the effect inclusive or exclusive, similar to RaycastParamsRaycastFilterType Enum.

3 Likes

I know this is extremely late but I’m bumping this, I’d argue a CollisionConstraint’s actually more useful than NoCollision, and I’m surprised roblox didn’t implement an exclude/include property to collisionConstraints in the first place

3 Likes

I could definitely use a feature like this!

This feature would massively help me with creating my ragdoll system.

I want to have one player character (the holder) carry a different player character (the carried character). The carried character shouldn’t interact with any world physics, they are just sitting on the shoulder of the holder.
However, I’d like there to be physics interactions between the holder and the carried character (to display the fun effects of ragdolling on someones shoulders).

It’s currently non-trivial to get this solution – it involves collision groups and disabling collisions between all other collision groups. Having the opposite of a NoCollisionConstraint would make this 10x easier.

I would be totally OK if the solution involved enabling collisions between specific assemblies, rather than specific parts. Alternatively, I would be OK if you could force enable collisions between certain parts within an assembly.

2 Likes

I’m afraid that would make everything CanCollide false. As I mean the player would continuously fall through the world into the void. Besides, everything has collision, so adding a CollisionConstraint would make no sense.

Correct, which is why I have a RigidConstraint in place to ensure that they do not fall in my example.


If I have CanCollide=false, then not everything has a collision.