Instantiate multiple cubes when I hold mouse down and drag.

Hello.

My cubes are 1,1,1. I want to allow the player to instantiate multiple cubes as he holds down mouse rather than just 1 at a time on mousebuttondown.

I use c# atm.

I thought about vector3.lerp but I am unfamiliar with it.

It would also be very nice if the boxes would be placed on top of pre existing boxes so they stack into a wall.

https://forum.unity3d.com/threads/instantiate-along-a-line-while-dragging.196148/