Thanks!
But I have doubt in second parameter of this method is_point_in_polygon
Can it be $Polygon2D.get_polygon()?
Help me please | 2021-08-18 09:47
Yes… If you can’t make it work, tell me and I’ll prepare an example
estebanmolca | 2021-08-18 10:35
Thanks a lot!
You did a great help to me. I was earlier going to do very stupid things to make this work.
But now
func _input(event):
if event.is_action_pressed("click"):
if Geometry.is_point_in_polygon(event.position, $Polygon2D.get_polygon()):
print("successs") ### And it prints success
Help me please | 2021-08-18 11:32
Very good. I’m glad I was helpful. The Geometry class has other useful functions like doing Boolean operations between polygons, intersections etc.