How can I detect when a part touches terrain? I’m using this for a helicopter crash script, but I’m not sure how to do this. Any help is appreciated!
I don’t think there’s something like “.Touched” for the terrain.
The only thing that comes to my mind is making an invisible part over the terrain and then using the “.Touched” event.
Hope this helped, have a nice day!
I see how that would work, however it would be time consuming and overall, not the best option to go with, considering my current terrain:
I appreciate the help, though.
if Hit:IsADescendantOf(workspace) and not Hit:IsA("BasePart") then --do stuff end
I haven’t tested it yet, but doesn’t BasePart:GetTouchingParts() check for terrain? I remember reading that somewhere.
I thought .Touched did work for Terrain?
I’d hope so, since GetTouchingParts() is probably not performant to be called too many times in a row.
If .Touched doesn’t work, then multiple Raycasting with a Whitelist containing only the Terrain should work. Since you’d only need to cast a handful of rays in a few directions from the center of your helicopter AND your rays only need to be ever so slightly longer than the helicopter’s distance from its center, those short rays won’t be resource-consuming, so that’s probably the most performant way to go.