Step 5
Step 4+ - Sphere position was only being updated on raycast. Move the logic out of the intersect call and use sphere position instead of mouse position - Depth keeps going indefinitely. Apply global max depth (even for this demo), imagine it's the depth of snow, and you can't make trails deeper than the snow is: - float newHeight = max(heightmapValue.y + change, -sphere.z * 0.8); this makes max depth just a bit smaller than the sphere's radius - fix: Sphere trail was inaccurate. It didn't need to be moved by half radius. I meant to move sphere by half of it's diameter. - make the trail slowly disappear: