Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What are some alternatives to Touched?

Asked by
iXBruv 24
4 years ago

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!)

0
Touched is not laggy... Prestory 1395 — 4y
0
^^ Touched itself isnt "laggy", but using touched ended can have weird outcomes. Better to use another alternative. Alphexus 498 — 4y
0
That's incorrect we are not talking about touch ended at all Prestory 1395 — 4y

1 answer

Log in to vote
0
Answered by
Alphexus 498 Moderation Voter
4 years ago

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!

Ad

Answer this question