I want to find parts that are near a diagonal line like this:
You could probably use SphereCast (unsure if it’s fully out) then you could make the size as big as you need; then cast as usual (startpos to endpos).
Would that also give me the distance from the line like .magnitude does?
Uhhh I’m not sure, I’ll edit this reply when I read the documentation.
Here’s the documentation for reference:
Seems like it does have a distance property but you might have to try it yourself
I would define a Ray using an origin and a direction (with a unit length), then loop through each part and call ray:Distance(part.position) to find the closest parts.
Alternatively you could implement the same function yourself with dot product.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.