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

RayCasting General question with FindPartOnRay and ignorelist?

Asked by 6 years ago

Hello everyone, I was looking into Raycasting and only noticed that when you cast a ray, it returns the first part that was hit, and no parts after. I was wondering if there was a way with ignorelist and FindPartOnRay to make it be able to say, go through multiple parts. I was thinking about making a value, let’s say 3, And whenever it detects the first part, it can ignore it and continue, but the function is that whatever the Ray hits, turns blue or something. So I was thinking I could use FindPartOnRay to find the first part, act on it, reduce the value of how many parts it can now hi to 2 and then put it into the ignorelist so it can continue its trajectory? I’m not sure, I would like to get some general advice and sense of direction as to where I could head to script something like this. A ray that can go through certain objects an affect them in a certain way.

Answer this question