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

Looking to find another way of checking if Part/Model is Near?

Asked by
Neu_Dev 22
5 years ago

I was looking for a way to check if a Part is near any model in the workspace and each model has StringValue that Name was Type and possible values is Rock, Grass, Ice. I tried to wrap my head around this thinking this through i thought i might use Magnitude but.. i wanted to do differently that makes it easier in a way that i won't have to collect all the models for example using for loops and has the StringValue in it and check what type it is.. is there any possible way?

0
Magnitude is actually the easiest way to do this. If you try to do it any other way, you're basically reinventing the wheel. DeceptiveCaster 3761 — 5y
0
Unless you really want to make your own system, magnitude is the best thing for you to use. ForeverBrown 356 — 5y
0
If you want all parts that are near model, consider FindPartsInRegion3 function. You can also use FindPartsInRegion3WithWhitelist or FindPartsInRegion3WithIngoreList, if you know what you are looking for. Magnitude would be the best if there are not many parts to iterate through, and calculate magnitude for each one. sleazel 1287 — 5y
0
Still reinventing the wheel, and Region3's are more difficult to work with than magnitude DeceptiveCaster 3761 — 5y
View all comments (2 more)
0
You can use Part.Touched:Connect(function(hit) and then check if the hit's name was the other part you wanted to be near TheRealPotatoChips 793 — 5y
0
You can make that part invisible so players cannot see it and set its cancollide to false so players cannot collide with it. TheRealPotatoChips 793 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Use magnitude for this as it would work best

Ad

Answer this question