Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What are some alternatives to Touched?

I know I have already asked many questions, but this is one I and my friend constantly struggle with. Touched being laggy. I know there's raycasting, but how is that used? I don't think the wiki explained it well enough. (I just need an alternative, if you have something that's not Touched that would be appreciated!)

3 comments

0

Touched is not laggy...

0

^^ Touched itself isnt "laggy", but using touched ended can have weird outcomes. Better to use another alternative.

0

That's incorrect we are not talking about touch ended at all

1 answer

✓ Accepted answer

It depends on what your using it for. I do agree the touched event is not the best case to go to. There are other alternatives. Like you mentioned: raycasting.

-- Raycasting --

Raycasting is a great alternative. I suggest you try to get help from YouTube since you don't quite understand it from the wiki. Basically, you cast a ray from the part to where you want to detect. I know it may be a little confusing.

-- Region3 --

Region3 is also a good alternative. Say you want to detect if a player is within a part. Basically you would make a region3 on the part and make the Y-Axis a little bigger. So as I was explaining, to detect a player, you would use the built in function for region3 and find "Part.Parent:FindFirstChild("Humanoid")" There are also other ways to do it. But this worked the easiest for me.

Well, those are the only alternatives that I have used and had worked. There may be other ones out there, but these do work quite well. I hope I helped you out. Thanks, and keep on scripting!

This discussion is preserved as it was. New answers, comments, and votes are closed.