How to leave a trail behind moving pencil?

I can’t find a way to do this. It needs to be stuck to the surface on which the pencil goes. Please help

This is gonna be tough on 3d objects, Is this in the UI or on a 3d object?

3d objects have to be unwrapped with UV’s set to a 2 dimensional plane before importing, for those of us using objects created with 3d modelling software (not Unity assets). When we do this, we can bake materials onto the object, and also Unity can bake some textures on static objects. You are going to want to be able to modify the object material in realtime. I think anyway, it is over my head i just though i’d try and give you some direction. Best of luck.