I have over 200 unique .Touched events in many scripts under Client RunContext, so instead of rewriting every single one or adding the “if then” i wanted to just completely turn off collisions of other players.
Reproduction Steps:
I enabled TouchEventsUseCollisionGroups to ensure other players can’t fire .Touched on the triggers around the map
I made players spawn with “Player” CollisionGroup using StarterCharacter and my LocalScript changes LocalPlayer’s character CollisionGroup to “Local”, CollisionGroups has following settings:
Touch events are a bit nonintuitive. A Touched signal will be sent any time a touch event occurs on any client or server. For example, when Player2 touches the green part, the touch is detected on the Player2 client, but it is replicated to the server and all clients, including Player1. Therefore, Player1 receives a Touched signal and prints the message.
TouchesUseCollisionGroups is not used to “filter” the touch events that get replicated from other clients or the server. It just determines which collision groups trigger a touch event locally. In the previous example, Player1 does not simulate Player2, so the collision between Player2 and the green part is not simulated by Player1. Instead, Player1 relies on Player2 (or the server) to tell us a touch occurred, and Player2 uses its local collision group information to do so.
This post has some nice guidance about handling touch events. In your case, you’ll likely need to add some logic to check who triggered the touch event.