Using a Line2D node to create physics bodies in Godot

Опубликовано: 25 Январь 2022
на канале: The Shaggy Dev
6,768
214

Let's look at how we can use the Geometry class and the techniques demonstrated in the Polygon2D video to create static and rigid bodies in Godot from Line2D nodes. This is done using the offset_polyline_2d function, which let's us take a line and buffer it by a given amount to create one or more polygons.

Intro: 00:00
Static bodies: 00:30
Rigid bodies: 01:32
Running the sample: 02:42

Godot 3 documentation: https://docs.godotengine.org/en/3.5/c...

Godot 4 documentation (renamed but functions the same): https://docs.godotengine.org/en/stabl...

Polygon2D video:    • Using a Polygon2D node to create phys...  

Source code: https://github.com/theshaggydev/the-s...

Text version: https://shaggydev.com/2022/01/25/line...

Donut Roll (the game showed at the end): https://theshaggydev.itch.io/donut-roll


Смотрите видео Using a Line2D node to create physics bodies in Godot онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал The Shaggy Dev 25 Январь 2022. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 6,768 раз и оно понравилось 214 посетителям.