You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Changes
I've optimized the script for handling collision groups in Roblox. The
main change involves removing the connection to DescendantAdded,
applying the collision group immediately to all parts in the model upon
character addition. This reduces unnecessary event connections,
improving performance by applying the collision group once for all
descendants, rather than repeatedly when new parts are added. This
should help improve game performance, especially when handling many
parts or players.
## Checks
By submitting your pull request for review, you agree to the following:
- [x] This contribution was created in whole or in part by me, and I
have the right to submit it under the terms of this repository's open
source licenses.
- [x] I understand and agree that this contribution and a record of it
are public, maintained indefinitely, and may be redistributed under the
terms of this repository's open source licenses.
- [x] To the best of my knowledge, all proposed changes are accurate.
---------
-- If the player already has a character, apply the collision group immediately
283
+
ifplayer.Characterthen
284
+
setCollisionGroup(player.Character)
285
+
end
286
286
end)
287
287
```
288
288
@@ -360,4 +360,4 @@ The `Class.TriangleMeshPart.CollisionFidelity|CollisionFidelity` property has th
360
360
To view collision fidelity in Studio, toggle on **Collision fidelity** from the [Visualization Options](../studio/ui-overview.md#visualization-options) widget in the upper‑right corner of the 3D viewport.
361
361
</Alert>
362
362
363
-
For more information on the performance impact of collision fidelity options and how to mitigate them, see [Performance Optimization](../performance-optimization/improving.md#physics-computation). For an in‑depth walkthrough on how to choose a collision fidelity option that balances your precision needs and performance requirements, see [here](../tutorials/environmental-art/assemble-an-asset-library.md#collisionfidelity).
363
+
For more information on the performance impact of collision fidelity options and how to mitigate them, see [Performance Optimization](../performance-optimization/improving.md#physics-computation).
0 commit comments