Drawing on a plane in Unity

I wanted to create a drawing tool in Unity, something akin to the brush in MS Paint. I want to apply a colour on a white plane at the mouse cursor position.

I’ve never done anything like this and I was wondering what would be the best approach for applying the colour.

I was thinking about 2 possible approaches:

  • Create a new GameObject with the Line Renderer component for each “stroke” and add points to the Line Renderer in certain intervals of time or distance.
  • Spawn GameObjects with the Sprite Renderer component that would have a sprite resembling a paint drop in certain intervals of time or distance.

Am I on the right track with the approaches that I came up with? Is there an easier solution that I am missing?

The closest thing Iv done to this is top-down view of 100 cubes or so, all arranged neatly in a grid. I then had invisible sphere follow the mouse. Gave the sphere a tag, then gave all the cubes a simple script saying if they touched the sphere and the mouse was held down then change colour. It was more like pixel art.

Sorry if this doesn’t help but maybe will give you food for thought.