0 votes

I want to move points of a polygon2d in code, with GDscript. I really dont know where to start with this problem.

Godot version V3.4
in Engine by (15 points)

1 Answer

0 votes
Best answer

Polygon2d.polygon returns an array of all points for this shape. Identify points You need to move, and refer to them just as You would refer to an array entries :

Polygon2d.polygon[3] += Vector2(5,0)

this moves 4th point of polygon 5 pixels to the right

by (7,755 points)
selected by

Thanks a lot, it is working... <3 :D

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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.