How could I detect if a part's size and position is in the bounds of a surface?

Hey DevForum,

I’ve made a physics-based ““liquid”” system that creates puddles on the surface it hits. The only issue that I have is that the puddle may go outside the bounds of the surface.

As you can see, the ray hit the target, but the puddle expanded too far. There are two ways I’d like to solve this:

  1. Reflect the ray if there isn’t enough space (Simple and effective)
  2. Check if there’s enough space to fill in another position that’s closest to the hit point. If not, reflect. (More complicated, but better overall solution)

If anybody could help out, that would be very appreciated. :happy3:

2 Likes

Bumping this, tried fixing this for a while and still got no progress.