How to animate deforming scratches? I would like to create the following animation: one mesh scrapes the other.
I think the best option is to animate the boolean modifier, but the boolean difference disappears as the object moves. I would like the difference remain to make it look like a scratch.

The next idea was to use dynamic paint (displacement), but it leaves a lot of &quot;artifacts&quot;, I believe due to dragging the outer vertex?

Could you suggest me other solutions that may work as intended?
I tried searching for it on the internet but with no luck so far.
Edit: The above examples are simple, but what about more complicated scratches?
In the first example why not use a rectangle instead of a square for the boolean so the backside is longer and doesn't disappear as it goes over the bottom cube. You could animate lots of strange shapes for options.
You may also want to do something like in the unrelated answer to this question here:
Animating appearing/extending strip with gaps