How do I prevent a texture from stretching when using a boolean modifier on the object? I made a lava planet and used the boolean modifier on a cube to "eat" it away.
For the planet I made a material in the Shader Workspace. When I move the cube on the planet and it eats the planet away the material is moving and stretching.

How can I "lock" the material on the planet?



So here you can see, that the material is stretching and not staying in the position it is in the first picture:



So how can I "lock" the material on the "skin" of the planet, so it doesn't move or anything, when the cube is "eating" the planet?
If using generated texture coordinates, such as:



The coordinates will be between 0 and 1, whatever the object size is.

So if we apply a boolean, the resulting object size changes and the texture stretches (which can be an interesting effect, by the way):



If we use 'object', like here:



Coordinates are stable in object space as they are the real coordinates, not remapped between 0 and 1.

So: