How to Make a paintbrush ?

I want to make a cube that when you move it paints a color on the plane, not based on mouse or keyboard inputs or camera. Just when the cube or the objects collide with the plane that is painting on the object. Because i have no idea how to build this, if someone could help me or give me an idea that would be great. =)

Thank you!

If you just want to update a texture, you could use Unity - Scripting API: Texture2D.SetPixel

You will have to do texture u.v calculation backwards to find out what pixel in the texture is coloring what point on the object.
This is non-trivial and I don’t think Unity has any pre-written functions for it.