Updates to Collision Groups

We will add an API for the check and release it in the upcoming weeks.

10 Likes

Why do icons always look so out of touch? The UI isnā€™t bad. Itā€™s just the icon. For some reason, Roblox cannot get icons right. The colors donā€™t fit so it distracts me.

2 Likes

Please make collision groups effect touch events! I was trying to have a touch event hitbox, but because the part count of other objects was high, the server load went through the roof

I bring you good news, Touched events already can be affected by collision groups, itā€™s just not the default behavior. Turn on the TouchesUseCollisionGroups setting if you want that behavior:

image

16 Likes

I was not a fan of the quite verbose and inconvenient to type API of PhysicsService, so Iā€™m really happy the API for collision groups is being streamlined.

New collision group editor also looks great and way more functional, so kudos!

4 Likes

Wonderful. Could we also get an update so that we can use both collision group names and IDs to call PhysicsService functions? e.g
Screenshot 2022-09-19 at 9.49.06 PM

5 Likes

Why create new functions with the same functionality and deprecate the old ones when there is nothing wrong with them? Seems entirely unnecessary unless the new functions behave differently.

4 Likes

The technical difference is the return type, but itā€™s really about intent, of both us and the developer.

It makes it more clear to developers that they should no longer use Ids, and it makes it clearer to people reading Lua code whether code was written under the old approach of using Ids or the new approach of using names.

Technically since collision groups still have an id under the hood, we could continue to use the same API method, however in both regards mentioned above the intent would be much less clear that way.

4 Likes

Wait, why? Why canā€™t CollisionGroup[string] just be a convenient setter/getter by name for the CollisionGroupId? Why does it actually have to be stringly typed, and the two properties not linked at all?! This is bad!

4 Likes

I donā€™t mind these changes, they donā€™t seem something too big.
If GetCollisionGroupName will be deprecated, how else can we get the collision groupā€™s name?
Will the CollisionGroupId still be a thing after these changes? I donā€™t think we need it, but just asking to be sure.

Also still prefer my plugin, although it needs a refreshment in the UI:

image

1 Like

WOW this is awesome, no more having to tediously write out commands in the console to get the right names and IDs.

1 Like

Nice work on the plugin.

No, we will eventually deprecate the property. It will be accessible in Lua for backward compatibility, but wonā€™t show up in the auto-completion etc.

We donā€™t have a replacement for this since the input of the method is CollisionGroupId

5 Likes

Iā€™m having a bug(?) with this change and Iā€™m not sure if itā€™s on Robloxā€™s end or my end. The CollisionGroupId doesnā€™t change when assign collision groups via CollisionGroup[string].

Do I need to change both CollisionGroup[string] and CollisionGroupId[int] for now? Iā€™m planning to only use CollisionGroup since CollisionGroupId is going to be deprecated.

The Collision Group Name will roll out a few days later.

4 Likes

Such system should be added to particle emitters.

1 Like

Oh alright. It explains that! Thanks for the clarification.

Great update! I donā€™t know what they were thinking when they made the original service. It was so convoluted before.

2 Likes

Come on! They never fixed collision groups to not affect ray casting!

What specific issue are you having here? You can explicitly choose how you want raycasting to interact with collision groups by setting CollisionGroup on the RaycastParams.

Have you tried wrapping the function in a pcall? That way if it errors out, you will get that indication without it crashing your script.

1 Like