Should i use GetTouchingParts or Touched event?

Hi,
I want to detect which parts player touching and if parts name for example “Circle” then it will do a function. So should i use GetTouchingParts or Touched event to detect what player touch? I mean which is better? Or what a difference

1 Like

You should used the Touched event.

GetTouchingParts() returns all parts the player is touching. This is expensive and has to be called everytime you want to get the parts the player is touching - which isn’t really valid in your case.

The Touched event will fire everytime the part comes in contact with something. This is most preferable if you’re waiting for the part to come in contact with another part.

If you’re simply only going to use the touch stuff to determine whether a player is in a circular area, I’d suggest getting the distance the player is from the center of the server, which is way less impactful on performance than touch is. Though if you’re sparse on the number of calls/events you connect to touch, I don’t think you’ll see much of a difference.

2 Likes