teststrecke-game/scripts/line_2d_collision.gd
2024-12-04 16:30:43 +01:00

14 lines
273 B
GDScript

extends Line2D
func _ready() -> void:
var staticbody:StaticBody2D=get_child(0)
$".".visible=false
var line_poly=Geometry2D.offset_polyline(points,width/2)
for poly in line_poly:
var col = CollisionPolygon2D.new()
col.polygon=poly
staticbody.add_child(col)