Error "Condition ' ps % != 0 is true" when rendering a ViewportTexture i update on movement.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Svampen

I’ve written a simple fov algorithm using raycas and updating a polygon in a separate viewport which i then use as a lightmask in a TextureRect.

However while testing the algorithm i noticed that sometimes i get an error and the polygon isn’t drawn.

The error message is:
ERROR: VisualServerCanvas::canvas_item_add_triangle_array: Condition ’ ps % 3 != 0 ’ is true.
At: servers\visual\visual_server_canvas.cpp:714

Is it the same as ‘Bad Polygon’?

Just setting the polygon works fine and also drawing the polygon to the current viewport instead of a separate one, so i think it’s an issue with rendering the viewport.
I’m currently using a 3.1 nightly build.

Appreciate any help.

Edit: Nevermind i’m just stupid and ended up adding the same vertex to the polygon multiple times. Disregard question.