Wednesday, April 18, 2018

17. CollisionPolygon2D

We add another Area2D node, renamed as walls, and we create a child of CollisionPolygon2D. Should we want a visual wall, we will also want to add a sprite.


In the editor we can click on + at top and add points. Finally we can click on the top to close the collision shape.


We can edit the vertices in the Inspector for more positional control, or even pass them programmatically.


This shows the node structure so far and the collision shape for the wall.


No comments:

Post a Comment