Hey everyone! I’m trying to create mining tools that dig only within certain terrain materials. For this use-case, picture a sphere cursor digging into the Asphalt material and replacing it with Air. Once the player reaches another material, it simply doesn’t replace that material with air. I’ve been using Terrain:FillBall()
for the prototype but encountered an issue when the cursor goes out of bounds of what’s left of the Asphalt material.
My problem is that I want to use the ‘Terrain:ReplaceMaterial()’ method, but it only uses Region3. My concern is that we are able to do this very easily with the built-in studio Terrain editor, using both the Paint and Replace Material tools, but I’m unable to find any source code, and the only other DevForum post I’ve seen about this topic has been deleted or made private. There was one other, but the solution the user found turned out to no longer work (RotatedRegion3 module).
Truthfully, I can switch to using Cubes/Region3s for the time being but my particular use-case would be best with spheres. Has anyone else encountered this issue or found a solution?