Changes in the CollisionPolygon2D do not apply

EduardoWeberEduardoWeber Posts: 3Member
edited December 1969 in 2D
Hello,<br />I started to use Godot some time ago, and it's far better than I have imagined, but, there is some times that a just get stuck for hours.<br />Today I were trying to change a CollisionPolygon2D Polygon like this:<br />
<br />var polygon = get_node(&quot;KinematicBody2D/CollisionPolygon2D&quot;).get_polygon()<br />polygon.set(0, Vector2(100,100)) #ORIGINALLY IT&#039;S 0,0<br />get_node(&quot;KinematicBody2D/CollisionPolygon2D&quot;).set_polygon(valor)<br />
<br />But in game it still is at 0,0

Comments

  • p1tp1t Posts: 1Member
    Hi!<br /><br />Looks like your getting the polygons in the variable "polygon".<br />And in set_polygon your using a variable called "valor".<br /><br />
  • EduardoWeberEduardoWeber Posts: 3Member
    Oh god, I'm out of my mind.<br />How did I missed that?<br /><br />Thanks.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file