GodotComponentTest/utils/CollisionLine.gd

14 lines
282 B
GDScript

class_name CollisionLine
extends KinematicBody2D
onready var collision = $CollisionShape2D
func _ready():
pass
func _draw():
if collision.shape is SegmentShape2D:
var segment_shape = collision.shape
draw_line (segment_shape.get_a(), segment_shape.get_b(), Color(1, 1, 0))