How do i get rid of the gaps in the lines?

i’m using draw canvas to render target to make a simple drawing UI, but the lines always have these gaps in them, how do i make the lines smooth?

i’m almost certain that i need to do something with the lerp, but nothing i’ve tried has helped, so maybe i’m wrong

Hey @Mathos1453! Welcome to the forums!

The screen snip is too far away :frowning: Can you get us some pictures that are closer up? It’s making the resolution too small, maybe break it up into 2 or 3 pics instead? We need to be able to read the text, we need to see the context :P.

But without looking at the code I will say it’s likely that you should generate lines BETWEEN the points instead of generating ON the point because it will only do that every frame. If you move the reticle too quickly you will get gaps, like when you move your mouse across your screen really fast, how it skips.

So to do that, on tick you
GET Old Point → Get New Point → Draw line between new point and old point → set new point as old point and voila you got a constant frame-by-frame loop while mouse is held. You constantly recycle points from new to old this way.

Hope that helps! :slight_smile: Let us know if you need more help and bring some more close-up pics!

(post deleted by author)

thank you! and sorry about the pictures, i hope these are more clear

It seems you were trying to draw a line by drawing many circles. But in your attempt, you made your for loop exit the function on its first iteration. The return node should be connected to the completed pin of the for loop. However, drawing many circles will not draw a line.

Here’s a material function that will draw a proper line. Start and End positions coordinates are in percentages. (0 to 1).

MF_ScaleToHalf is subtract 0.5 and then multiply by 2.

The output is opacity, so just connect it to your opacity pin on your material.

Here’s an example UI material:

that did it! thanks!

HAHA Nice!