How to draw a 2d trail for gui obects?

This is the best visual example of what I am wanting:

I know its possible, and it has something to do with loop’s and velocity, but my atempt didint work out, so maybe someone could point me do a good example of such a trail effect. Thanks.

If you show your attempt, there would be a discussion basis…

my code is to large to post it here, I’ll re write the part of my atempt.

			Vector2 bodyAccDotPrevPosition = bodyAccDotPosition;
			bodyAccDotPosition = Event.current.mousePosition;
			Vector2 vel = (bodyAccDotPosition-bodyAccDotPrevPosition)/Time.deltaTime;
				
			if(bodyAccelerationDot)
			{
				for(int i=0; i<100; i++) 
				{
					Rect bodyAccDotRect = new Rect(bodyAccDotPosition.x+(i*vel.x*100),bodyAccDotPosition.y+(i*vel.y*100),32,32);
					if(bodyAccelerationDot)
						GUI.DrawTexture(bodyAccDotRect,bodyAccelerationDot);
				}
			}