Terrain physics ignoring collision groups

Reproduction Steps

terrainContactBug.rbxl (49.6 KB)

image

If you try and make a physics part that has collision enabled, and collision grouped to collide with players but not the terrain you can do so, but the part will generate collisions and contacts with the terrain anyway.

This has a severe performance impact on my game, where I have a lot of small floating platforms (enemies and their sub parts) floating near terrain and are generating hundreds of contacts. They shouldn’t be generating any contacts at all as they’re set to not collide with anything via collision group, but still trigger terrain contacts.

I think I have correctly set the collision id on the terrain object in the workspace.
I have tried toggling TouchesUseCollisionGroups to no effect.

Expected Behavior
No contacts get generated when a part is in a collision group that does not include the collision group for terrain, but still has its collision turned on.

Actual Behavior
Contacts get generated for parts that have collision on, but are in a collision group that should in theory excludes the terrain.

Workaround
Yes, but actually no.

Setting the collision to completely “off” solves it, but I want these parts to be able to collide with the character and not the terrain.

So right now I can manually check the distance to the player locally, and turn collision off on distant parts.

This is, of course, yuck.

Issue Area: Engine
Issue Type: Performance
Impact: Moderate
Frequency: Constantly

4 Likes

Do you have CanTouch false on those Parts? It would help to keep the calculation of collisions to a minimum.

Also there is a Studio setting in the Physics tab that reads something like “Show Collisions” which displays a red ball at collision points in your game.
I keep it on all the time since I deal with a lot of vehicles and need to see where Parts are touching each other.

Yeah the parts have CanTouch and CanQuery to false.
Those contacts don’t show up in the visualizer, but they do show up in the performance analysis and definitely show up in the profiler.

To give more information, I have a game where there’s 20 or so giant crabs made of 10 parts each wandering around a beach. They are set to collide with absolutely nothing, via collision groups, and have CanTouch and CanQuery set to false.

But the engine is still generating 150+ contacts for them because they were near terrain.

So I took a little while to build a simple reproduction of the problem, which is here.

Thanks for the report! We’ve filed a ticket to our internal database and we’ll follow up when we have an update for you.

3 Likes

Sorry for the late response here. This should be resolved, anyone still having issues?

1 Like

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