I’m developing this raycast particle rain system, and I’m now trying to add rain that pours off of roofs. The only solution I have to this problem would only work for Parts with the Block shape.
How would I get this to work for terrain, meshes, and other shapes?
I know how to create the water effect itself and to find where it would end, but I don’t how to calculate where it starts.
I’m trying to use the least amount of raycasts possible to keep a low script activity, so constant collision detection isn’t viable. But thats okay, I’m not trying to make a super accurate detection system, just something that works enough to look good and to be low activity.
This is a very interesting idea. I think there are a lot of ways to calculate locations where water will pour in advance, so that not a lot needs to be done once rain starts.
For meshes, if you know what triangle you are on, you could simply “flow” towards the lowest vertex, then follow the steepest triangle radiating out from that vertex until you find one that is no long a top surface, at which point you start dripping.
I don’t know much about how terrain works, but I bet it could work in a similar way.
Thanks for your idea, but I don’t think its possible right now. EditableMeshes have a method for getting faces and vertices, but regular meshes and terrain don’t. Converting everything into EditableMeshes isn’t really viable for me either.
There’s also a feature request from 2014 asking for methods on unions and regular meshes. Even if they add methods for meshes, I don’t think they’ll add it for terrain.
Your post gave me an idea though. I’ve been seeing water simulation with parts and terrain water recently. I might look into some of their water collision code tomorrow.