how to get the error code(bad polygon) in gdscript

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

I create ploygon2D when user move the sprite, but sometimes I got a error “bad polygon”,
I can’t get the error in the code, I found it in debug window,
I want to known how to get the error code(bad polygon) in gdscript ?

I don’t think you can get that error code… what do you need this for? If the polygon is misconfigured, there is not much you can do about it except not feeding bad input to Polygon2D. Do you really need to tell the player “your polygon is wrong”? Also there has been improvements in Godot 3.1 so perhaps that could help

Zylann | 2018-11-15 18:52

Thanks Zylann,
Yes I want to do some modify when the polygon is bad, make it draw again.
(eg. if some point overlay, we remove it)
but if we can’t get the error status, I have to check polygon status myself.
and I don’t known what 's the rule the polygon2D check bad polygon, may be I need check the Godot source code?

Thank you zylann, I will try 3.1 first.

zhengying | 2018-11-16 01:40