Godot Version
Godot 4.3
Question
Line2D texture is not loading in in game. How to fix it?
In game:
In editor:
Am generating the circle with code:
extends Area2D
@export var LineColor: Color
@export var InnerCircleColor: Color
var radius : float = 70
@export var max_points : int = 16
@onready var DASH_RANGE: CollisionShape2D = $DashRange
@onready var RANGE_EDGE: Line2D = $RangeEdge
func draw_edge() -> void:
RANGE_EDGE.clear_points()
var pos = Vector2(radius,0)
for p in range(max_points):
RANGE_EDGE.add_point(pos.rotated(PI*2/max_points*p))
func _draw() -> void:
draw_circle(position,radius,InnerCircleColor,true,1,false)
func _ready() -> void:
RANGE_EDGE.modulate = LineColor
DASH_RANGE.shape.radius = radius
func set_radius(new_radius: float) -> void:
radius = new_radius
DASH_RANGE.shape.radius = radius
draw_edge()
func _process(delta: float) -> void:
pass