cave-of-dreams/scripts/marker/camera_zone_marker.gd

25 lines
608 B
GDScript

@tool
extends Sprite3D
@export var max_distance_x = Vector2(-INF, INF)
func _process(delta: float) -> void:
var max_left = max_distance_x.x
var max_right = max_distance_x.y
var x_a = global_position
x_a += global_transform.basis * Vector3(max_left, 0, 0)
var x_b = global_position
x_b += global_transform.basis * Vector3(max_right, 0, 0)
if !((max_distance_x.x == -INF) and (max_distance_x.y == INF)):
if (max_distance_x.x == -INF):
x_a = global_position
elif (max_distance_x.y == INF):
x_b = global_position
DebugDraw3D.draw_line(x_a, x_b, Color(1, 0, 0))
visible = true