Geometry paint Help please

Hi everyone,

This is my first post here and hope someone can help me.

I am reading the "Autodesk Official training MaxScript essential" and tried the mouse track example in the book to place my objects on a surface.

Everything works fine but I have no control over the distance between objects being placed on the surface.

I have also seen Paint cloner by andrei kletskov which is great but I can't understand his code since I am still a beginner.

Could anyone plz tell me how I can control the distance using this code I have? Thanks in advanced.

Here is the code I have:

-- Function to track the mouse and plant a instance
function myFooFunction message intRay obj faceNumber shift ctrl alt =

returnValue = case message of
if (obj != undefined) and (intRay != undefined) do

pot.pos=intRay.pos --position
pot.dir=intRay.dir --direction


#mouseAbort: (undefined)
#mousePoint: (undefined)
#mouseMove: (#continue)