0 votes

Example of the issue.

I am working on a low-fi pixel platformer with grapple hook mechanic and I am trying to draw the rope of the grappling hook. I want the line to be 1px. Currently I am using a Line2D node for it, but I am having issues with the line rendering

As seen above, the line is shifting weight and is "breaking" at certain angles. I thought maybe the line drawing is not in sync with the rest of drawing. I have tried putting changes to the line inside physicsprocess() in hopes it will sync the rendering, and while it seems to improve it a little, it doesn't solve the problem - the line still changes width, breaks and now flickers (goes invisible on some frames)!

Then I thought it might be the fault of the camera, but disabling camera makes it even worse - the line is only visible only during the frames when it is perfectly straight.

I have also tried making the line wider by a decimal (width of 1.1 to 1.9). It makes the rope stay visible for sure, but it definitely makes the rope thicker (more segments are 2px than 1px, less so with something 1.1 but still the rope as a whole is thicker than 1pixel), and it still jiggles and flickers.

Now my thinking is that Line2D maybe is not meant to be used at runtime to generate graphics. Maybe there is another approach I am missing? Or is this a bug in the engine? I mean, it should be an easy task to draw a 1px line at any angle, but I am at my wits end.

I am open to any suggestions, either using Line2D or any other approach.

Just in case my settings can help / are relevant:

Godot 3.1
GLES2
Use Nvidia Flicker workaround checked
Pixel snap checked (this is needed for my game, disabling it helps, but the line still flickers and jiggles on top of other unwanted tileset behavior)
Mode: Viewport
Aspect: Keep
asked Jan 28 in Engine by Von_Bednar (12 points)
edited Jan 28 by Von_Bednar

I've never had that problem so maybe check your renders settings.

I was using the default settings (except the ones specified above). Any particular settings I should pay attention to?

I'm not sure. I've never had this problem.

Maybe it's the Z-index?

Because sometimes it fixes it's self and it looks like almost as if somethings blocking it.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.